@Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        HeapRow heapRow = (HeapRow) o;

        return Arrays.equals(values, heapRow.values);
    }
@Test
    public void testEquals() {
        checkEquals(new HeapRow(2), new HeapRow(2), true);
        checkEquals(new HeapRow(2), new HeapRow(3), false);

        HeapRow row1 = new HeapRow(2);
        HeapRow row2 = new HeapRow(2);
        HeapRow row3 = new HeapRow(2);

        Object value1 = new Object();
        Object value2 = new Object();
        Object value3 = new Object();

        row1.set(0, value1);
        row2.set(0, value1);
        row3.set(0, value1);

        row1.set(1, value2);
        row2.set(1, value2);
        row3.set(1, value3);

        checkEquals(row1, row2, true);
        checkEquals(row1, row3, false);
    }