Consider the following method:
public Set<String> mystery(Map<String, String> data) {
Set<String> result = new TreeSet<String>();
for (String s : data.keySet()) {
result.add(data.get(s));
}
return result;
}
The three entries below have specific values for the parameter to method mystery. For each entry, indicate what values would be stored in the set returned by method mystery if the given maps are passed as parameters.
map: {baz=c, mumble=d, foo=a, bar=b}
set returned:__________________________________________________________
map: {f=z, d=x, e=y, b=y, c=z, a=x}
set returned:__________________________________________________________
map: {f=2, g=10, d=20, e=1, b=10, c=2, a=1, h=20}
set returned:__________________________________________________________