+ public static final Function<Identity, Set<String>> TO_CONTEXTS = new Function<Identity, Set<String>>() {
+ @Override
+ public Set<String> apply(Identity identity) {
+ return (identity == null) ? Collections.<String>emptySet() : identity.getContexts();
+ }
+ };
+
+ public static final Function<Identity, Collection<Map.Entry<String, String>>> TO_PROPERTIES = new Function<Identity, Collection<Entry<String, String>>>() {
+ @Override
+ public Collection<Entry<String, String>> apply(Identity input) {
+ return (input == null) ? Collections.<Map.Entry<String, String>>emptySet() : input.getProperties().entrySet();
+ }
+ };
+