@Override
  public Object apply(Object value) {
    if (!(value instanceof Iterable)) {
      return value;
    }

    if (value instanceof HashSet || value instanceof ArrayList || value instanceof TreeSet) {
      // don't convert java collections (assume no guava implementations exists inside it)
      return value;
    }

    // transform to java collections
    Collector<Object, ?, ? extends Iterable<Object>> collector;
    if (value instanceof SortedSet) {
      collector = Collectors.toCollection(TreeSet::new);
    } else if (value instanceof Set) {
      collector = Collectors.toCollection(HashSet::new);
    } else {
      collector = Collectors.toList();
    }

    return StreamSupport.stream(((Iterable<Object>) value).spliterator(), false).map(this::apply).collect(collector);
  }
This function is used for OQLs of type
{@code select * form /region where id in $1} (where {@code $1} is a guava collection).
Helpful in cases when client has guava library but server has not.

<p>By default, Geode can't deserialize Guava collections (and other guava classes) since guava might
not be on servers classpath. Bind variables in OQL are serialized using standard java serialization.

<p>Manually "clone" collections into a standard java collection implementation
like {@link ArrayList} or {@link HashSet}.
criteria/geode/src/org/immutables/criteria/geode/BindVariableConverter.java