import java.util.function.Function; import java.util.*; class Test { void m(Set i) { final List getters = new ArrayList(map(i, new Function() { @Override public String apply(String propertyName) { return propertyName; } })); } public static List map(Iterable iterable, Function mapping) { return null; } public static List map(Collection iterable, Function mapping) { return null; } }