public static <V> IntTo<V> asList(@SuppressWarnings("unchecked") final V ... elements) { @SuppressWarnings("unchecked") final Class<V> cls = Class.class.cast(elements.getClass().getComponentType()); final IntTo<V> list = service.newList(cls, MUTABLE_LIST); for (final V item : elements) { list.push(item); } return list; }
public static <V> IntTo<V> asSet(@SuppressWarnings("unchecked") final V ... elements) { @SuppressWarnings("unchecked") final IntTo<V> list = (IntTo<V>)newSet(elements.getClass().getComponentType()); for (final V item : elements) { list.push(item); } return list; }