### Question:
Permissions { protected void add(Permission permission) { idMap.put(permission.getId(), permission); Set<Integer> permissionIdSet = unittypeIdMap.get(permission.getUnittypeId()); if (permissionIdSet == null) { permissionIdSet = new TreeSet<>(); } permissionIdSet.add(permission.getId()); unittypeIdMap.put(permission.getUnittypeId(), permissionIdSet); } protected  Permissions(DataSource dataSource); Permission[] getPermissions(); Permission getByUnittypeProfile(Integer unittypeId, Integer profileId); Permission getById(Integer id); static final String[] WEB_PAGES; }### Answer:
@Test public void add() throws SQLException { this.addTestData(); Permission newPermission = new Permission(user, unittype.getId(), profile.getId()); Users users = new Users(dataSource); Permissions perms = new Permissions(acs.getDataSource()); perms.addOrChange(newPermission); Permission createdPerm = perms.getByUnittypeProfile(unittype.getId(), profile.getId()); assertNotNull(createdPerm); assertEquals(newPermission.getUnittypeId(), createdPerm.getUnittypeId()); }