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

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

        MapTableIndex index = (MapTableIndex) o;

        return componentsCount == index.componentsCount
            && name.equals(index.name)
            && type == index.type
            && fieldOrdinals.equals(index.fieldOrdinals)
            && fieldConverterTypes.equals(index.fieldConverterTypes);
    }
@Test
    public void testEquals() {
        String name1 = "index1";
        String name2 = "index2";

        IndexType type1 = SORTED;
        IndexType type2 = HASH;

        int components1 = 1;
        int components2 = 2;

        List<Integer> ordinals1 = singletonList(1);
        List<Integer> ordinals2 = singletonList(2);

        List<QueryDataType> types1 = singletonList(INT);
        List<QueryDataType> types2 = singletonList(BIGINT);

        MapTableIndex index = new MapTableIndex(name1, type1, components1, ordinals1, types1);

        checkEquals(index, new MapTableIndex(name1, type1, components1, ordinals1, types1), true);

        checkEquals(index, new MapTableIndex(name2, type1, components1, ordinals1, types1), false);
        checkEquals(index, new MapTableIndex(name1, type2, components1, ordinals1, types1), false);
        checkEquals(index, new MapTableIndex(name1, type1, components2, ordinals1, types1), false);
        checkEquals(index, new MapTableIndex(name1, type1, components1, ordinals2, types1), false);
        checkEquals(index, new MapTableIndex(name1, type1, components1, ordinals1, types2), false);
    }