Be careful, == on Integer (not integer) may return false.
Ex : new Integer(4) == new Integer(4) is false . You  should use .equals( ) for objects ! Or use integer primitive.