Is there a built-in Java method that takes multiple cards as arguments and returns a set of all keys on these cards?
Sort of
public static Set<String> getKeys(Map<String, ?> ... arg2){
Set<String> result = new HashSet<>();
for (Map<String, ?> map : arg2) {
for (Map.Entry<String, ?> entry : map.entrySet()) {
String key = entry.getKey();
result.add(key);
}
}
return result;
}
source
share