code: public String getRealm(Subject subject) throws Exception {
          String realm = null;
          WSCredential credential = getWSCredential(subject);
          if (credential != null) {
              realm = credential.getRealmName();
          }
          return realm;
      }
docs: Gets the realm from the subjects' WSCredential.
  
  @param subject {@code null} is not supported.
  @return