*/
public final class MapImplJUnitTest {
@Test
public void ensureCopyWorks() {
User torgil = new User("Torgil");
User bahamas = new User("Bahamas");
Permissions fullAccess = Permissions.fullControl();
Permissions readOnly = new Permissions(EnumSet.of(Permission.READ), null);
Source original = new Source("S1");
Source copy = new Source("S2");
UserMap map = new UserMap();
map.put(original.getID(), torgil.getId(), fullAccess);
map.put(original.getID(), bahamas.getId(), readOnly);
map.setClean();
map.copy(original.getID(), copy.getID());
assertTrue(map.isDirty());
assertEquals(fullAccess, map.get(copy.getID(), torgil.getId()));
assertEquals(readOnly, map.get(copy.getID(), bahamas.getId()));
// Ensure changing permissions on original does not affect copy:
map.put(original.getID(), torgil.getId(), readOnly);
assertEquals(fullAccess, map.get(copy.getID(), torgil.getId()));
}