public class Main {
    private static final int ARRAY_LEN = Integer.MAX_VALUE - 32;
    private static final long MAX_ITERATION_COUNT = (1L << 32) + 2L;

    public static void main(String[] args) {
        Object[] array = new Object[ARRAY_LEN];
        for (long i = 0; i < MAX_ITERATION_COUNT; ++i) {
            Object o = new Object();
            int h = o.hashCode();
            if (h >= 0 && h < ARRAY_LEN) {
                Object old = array[h];
                if (old != null) {
                    System.out.println("duplicate hashCode " + h);
                    if (o == old) {
                        System.out.println("o == old");
                    } else {
                        System.out.println("o != old");
                    }
                    break;
                }
                array[h] = o;
            }
        }
    }
}