IndexTypeConverter implements Converter<org.apache.geode.cache.query.IndexType> { @Override public org.apache.geode.cache.query.IndexType convertFromText(String value, Class<?> targetType, String optionContext) { switch (value.toLowerCase()) { case "range": return org.apache.geode.cache.query.IndexType.FUNCTIONAL; case "key": return org.apache.geode.cache.query.IndexType.PRIMARY_KEY; case "hash": return org.apache.geode.cache.query.IndexType.HASH; } throw new IllegalArgumentException("invalid index type: " + value); }  @Override boolean supports(Class<?> type, String optionContext); @Override org.apache.geode.cache.query.IndexType convertFromText(String value, Class<?> targetType,
      String optionContext); @Override boolean getAllPossibleValues(List<Completion> completions, Class<?> targetType,
      String existingData, String optionContext, MethodTarget target);  }
@Test @SuppressWarnings("deprecation") public void convert() { assertThat( typeConverter.convertFromText("hash", org.apache.geode.cache.query.IndexType.class, "")) .isEqualTo(org.apache.geode.cache.query.IndexType.HASH); assertThat( typeConverter.convertFromText("range", org.apache.geode.cache.query.IndexType.class, "")) .isEqualTo(org.apache.geode.cache.query.IndexType.FUNCTIONAL); assertThat( typeConverter.convertFromText("key", org.apache.geode.cache.query.IndexType.class, "")) .isEqualTo(org.apache.geode.cache.query.IndexType.PRIMARY_KEY); assertThatThrownBy(() -> typeConverter.convertFromText("invalid", org.apache.geode.cache.query.IndexType.class, "")) .isInstanceOf(IllegalArgumentException.class); }