The previously used Number.equals() and hashCode() was just delegated to Object and hence did not behave as expected.