code: public static <T> Set<T> keyset(Set<T> set, KeyExtractor<T> keyExtractor) {
          Set<T> keyset = new HashSet<T>();
          for(T item : set) {
              keyset.add(keyExtractor.extractKey(item));
          }
          return keyset;
      }
docs: Create a keyset from a set using a {@code KeyExtractor}
  @param set original set
  @param keyExtractor key extractor
  @param <T> type
  @return a new keyset extracted from the original set