WindowsLoginModule implements LoginModule { @Override public boolean commit() throws LoginException { if (this.principals == null) { return false; } if (this.subject.isReadOnly()) { throw new LoginException("Subject cannot be read-only."); } final Set<Principal> principalsSet = this.subject.getPrincipals(); principalsSet.addAll(this.principals); WindowsLoginModule.LOGGER.debug("committing {} principals", Integer.valueOf(this.subject.getPrincipals().size())); if (this.debug) { for (final Principal principal : principalsSet) { WindowsLoginModule.LOGGER.debug(" principal: {}", principal.getName()); } } return true; }  @Override void initialize(final Subject initSubject, final CallbackHandler initCallbackHandler,
            final Map<String, ?> initSharedState, final Map<String, ?> initOptions); @Override boolean login(); @Override boolean abort(); @Override boolean commit(); @Override boolean logout(); boolean isDebug(); IWindowsAuthProvider getAuth(); void setAuth(final IWindowsAuthProvider provider); boolean isAllowGuestLogin(); void setAllowGuestLogin(final boolean value);  }
@Test void commit_noPrincipal() throws LoginException { Assertions.assertFalse(this.loginModule.commit()); }