@Test public void testHasPrincipalNullClass() { IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> { JaasUtils.hasPrincipal(null); }); assertThat(e.getMessage()).isEqualTo("Principal class cannot be null."); }
public static boolean hasPrincipal(final Class<? extends Principal> principalClass) { if (principalClass == null) throw new IllegalArgumentException("Principal class cannot be null."); return !getCurrentSubject().getPrincipals(principalClass).isEmpty(); }
JaasUtils { public static boolean hasPrincipal(final Class<? extends Principal> principalClass) { if (principalClass == null) throw new IllegalArgumentException("Principal class cannot be null."); return !getCurrentSubject().getPrincipals(principalClass).isEmpty(); } }
JaasUtils { public static boolean hasPrincipal(final Class<? extends Principal> principalClass) { if (principalClass == null) throw new IllegalArgumentException("Principal class cannot be null."); return !getCurrentSubject().getPrincipals(principalClass).isEmpty(); }  }
JaasUtils { public static boolean hasPrincipal(final Class<? extends Principal> principalClass) { if (principalClass == null) throw new IllegalArgumentException("Principal class cannot be null."); return !getCurrentSubject().getPrincipals(principalClass).isEmpty(); }  static Subject getCurrentSubject(); static P getPrincipal(final Class<P> principalClass); static T getPrivateCredential(final Class<T> credentialClass); static boolean hasPrincipal(final Class<? extends Principal> principalClass); }
JaasUtils { public static boolean hasPrincipal(final Class<? extends Principal> principalClass) { if (principalClass == null) throw new IllegalArgumentException("Principal class cannot be null."); return !getCurrentSubject().getPrincipals(principalClass).isEmpty(); }  static Subject getCurrentSubject(); static P getPrincipal(final Class<P> principalClass); static T getPrivateCredential(final Class<T> credentialClass); static boolean hasPrincipal(final Class<? extends Principal> principalClass);  }