void (final Int2IntMultimap multimap) { final IntOpenHashSet keys = new IntOpenHashSet(); multimap.forEach((key, value) -> keys.add(key)); for (final int key : keys) { final IntOpenHashSet values = new IntOpenHashSet(); multimap.lookup(key, value -> { if (!values.add(value)) { fail("get(" + key + ") values are non-unique: value[" + value + "] was already reported " + values); } return true; }); } }