### Question:
Permissions { protected void delete(Permission permission) throws SQLException { Connection c = null; PreparedStatement ps = null; SQLException sqle = null; try { c = dataSource.getConnection(); DynamicStatement ds = new DynamicStatement(); ds.addSqlAndArguments("DELETE FROM permission_ WHERE id = ?", permission.getId()); ps = ds.makePreparedStatement(c); ps.executeUpdate(); } catch (SQLException sqlex) { sqle = sqlex; throw sqlex; } finally { if (ps != null) { ps.close(); } if (c != null) { c.close(); } } idMap.remove(permission.getId()); Set<Integer> permissionIdSet = unittypeIdMap.get(permission.getUnittypeId()); if (permissionIdSet != null) { permissionIdSet.remove(permission.getId()); } } 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 delete() 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()); perms.delete(createdPerm); createdPerm = perms.getByUnittypeProfile(unittype.getId(), profile.getId()); assertNull(createdPerm); }