WindowsPrincipal implements Principal, Serializable { @Override public String toString() { return this.getName(); } WindowsPrincipal(final IWindowsIdentity windowsIdentity);  WindowsPrincipal(final IWindowsIdentity windowsIdentity, final PrincipalFormat principalFormat,
            final PrincipalFormat roleFormat); byte[] getSid(); String getSidString(); Map<String, WindowsAccount> getGroups(); String getRolesString(); boolean hasRole(final String role); @Override String getName(); IWindowsIdentity getIdentity(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test void testToString() { Assertions.assertNotNull(new Expectations() { { WindowsPrincipalTest.this.windowsIdentity.getFqn(); this.result = WindowsPrincipalTest.TEST_FQN; WindowsPrincipalTest.this.windowsIdentity.getGroups(); this.result = new IWindowsAccount[0]; } }); final WindowsPrincipal principal = new WindowsPrincipal(this.windowsIdentity); Assertions.assertEquals(WindowsPrincipalTest.TEST_FQN, principal.getName()); Assertions.assertEquals(WindowsPrincipalTest.TEST_FQN, principal.toString()); }