PrincipalImpl implements JackrabbitPrincipal { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getName()).append(':').append(name); return sb.toString(); } PrincipalImpl(String name); @Override String getName(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() { assertNotNull(principal.toString()); assertTrue(principal.toString().endsWith(principal.getName())); assertTrue(principal.toString().startsWith(principal.getClass().getName())); }