There seems to be quite a bit of repetition when checking the results, perhaps a helper method to create a HashMap from an Iterable<Map.Entry> would be useful.