code: public void checkTypeCompatible(final OClass.INDEX_TYPE... types) {
          final Set<String> allowed = Sets.newHashSet(Iterables.transform(Arrays.asList(types),
                  new Function<OClass.INDEX_TYPE, String>() {
                      @Nonnull
                      @Override
                      public String apply(@Nonnull final OClass.INDEX_TYPE input) {
                          return input.name();
                      }
                  }));
          check(allowed.contains(index.getType()),
                  "Existing index '%s' (class '%s') type '%s' is incompatible with '%s'. "
                          + "Either drop existing index or rename index.",
                  index.getName(), index.getDefinition().getClassName(), index.getType(), Joiner.on(',').join(allowed));
      }
docs: Checks that current index type is equal to one of provided types.
  If not, exception thrown. Type check is important for fulltext and lucene indexes because,
  most likely, if existing index type is different from that specific index type then index name was set
  by mistake and to avoid replacing existing index error should be thrown (programmer mistake).
  
  @param types allowed index types