code: private static boolean doesNameMatchPattern(final Principal principal, final Pattern pattern) {
          if (pattern != null) {
              val name = principal.getName();
              val result = pattern.matcher(name).matches();
              LOGGER.debug("[{}] matches [{}] == [{}]", pattern.pattern(), name, result);
              return result;
          }
          return true;
      }
docs: Does principal name match pattern?
  
  @param principal the principal
  @param pattern   the pattern
  @return true, if successful