SystemPrincipal implements Principal { @Override public String getName() { return "system"; } private  SystemPrincipal(); @Override String getName(); static final SystemPrincipal INSTANCE; }
@Test public void testGetName() { assertEquals("system", SystemPrincipal.INSTANCE.getName()); }
@Test public void testNotEqualsOtherPrincipalWithSameName() { Principal another = new Principal() { public String getName() { return SystemPrincipal.INSTANCE.getName(); } }; assertFalse(SystemPrincipal.INSTANCE.equals(another)); }
@Test public void testToString() { assertNotNull(SystemPrincipal.INSTANCE.toString()); assertNotEquals(SystemPrincipal.INSTANCE.getName(), SystemPrincipal.INSTANCE.toString()); }