I have integers that are supposed to be equal (and I verify it by output). But in my if condition Java does not see these variables to have the same value.
if
If they were simple int types, it would work.
int
For Integer use .intValue() or compareTo(Object other) or equals(Object other) in your comparison.
Integer
.intValue()
compareTo(Object other)
equals(Object other)