PrivilegeImpl implements Privilege { public boolean contains(Privilege p) { if (p.getName().equalsIgnoreCase(this.getName())) { return true; } Privilege[] list = getAggregatePrivileges(); for (Privilege privilege : list) { if (privilege.getName().equalsIgnoreCase(p.getName())) { return true; } } return false; } PrivilegeImpl(Session session, String name, Privilege[] declaredPrivileges);  PrivilegeImpl(Session session, String name, Privilege[] declaredPrivileges, boolean isAbstract); String localName(); @Override String getName(); @Override boolean isAbstract(); @Override boolean isAggregate(); @Override Privilege[] getDeclaredAggregatePrivileges(); @Override Privilege[] getAggregatePrivileges(); boolean contains(Privilege p); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode();  }
@Test public void testContains() { assertTrue(p4.contains(p3)); assertTrue(p4.contains(p2)); assertTrue(p4.contains(p4)); }