private boolean removeIndexByName(String name, QueryService queryService) {
    boolean removed = false;
    Collection<Index> indexes = queryService.getIndexes();

    for (Index index : indexes) {
      if (index.getName().equals(name)) {
        queryService.removeIndex(index);
        removed = true;
      }
    }

    return removed;
  }
@return true if the index was found and removed/false if the index was not found.
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyIndexFunction.java