code: public boolean checkPatternEquality(final Optional<Subject> subjectOption,
                                          final Optional<String> patternValueOption)
      {
          final boolean[] roleOk = {false};
          subjectOption.ifPresent(subject -> patternValueOption.ifPresent(patternValue -> {
              final List<? extends Permission> permissions = subject.getPermissions();
              if (permissions != null)
              {
                  for (Iterator<? extends Permission> iterator = permissions.iterator(); !roleOk[0] && iterator.hasNext(); )
                  {
                      final Permission permission = iterator.next();
                      roleOk[0] = patternValue.equals(permission.getValue());
                  }
              }
          }));
  
          return roleOk[0];
      }
docs: Check the pattern for equality against the {@link Permission}s of the user.
  
  @param subjectOption an option for the subject
  @param patternValueOption an option for the pattern value
  @return true iff the pattern is equal to at least one of the subject's permissions