PermissionSubjectsMap extends AbstractMap<String, Map<String, Integer>> { PermissionSubjectsMap copy() { final PermissionSubjectsMap copy = new PermissionSubjectsMap(); forEach((permission, subjectMap) -> copy.put(permission, new HashMap<>(subjectMap))); return copy; } PermissionSubjectsMap(); @Override Set<Entry<String, Map<String, Integer>>> entrySet(); @Override Map<String, Integer> put(final String key, final Map<String, Integer> value); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test public void copyOfEmptyRelationReturnsDifferentEmptyRelation() { final PermissionSubjectsMap copy = underTest.copy(); assertThat(copy) .isNotSameAs(underTest) .isEmpty(); }