static Constant ofType(@Nullable Object value, Type type) {
    Object newValue = value;
    if (value instanceof Iterable) {
      if (value instanceof Set) {
        newValue = ImmutableSet.copyOf((Set<?>) value);
      } else {
        newValue = ImmutableList.copyOf((Iterable<?>) value);
      }
    }
    return ImmutableConstant.builder().value(newValue).returnType(type).build();
  }
Converts current value to collection (if it is not already). If value
is iterable returns that collection (which is most likely ImmutableList already).

@return singleton list with current value or immutable list of values depending on type
of current value.
criteria/common/src/org/immutables/criteria/expression/Constant.java