code: public static boolean matches(AnnotatedElement annotatedElement) {
          Annotation[] annotations = annotatedElement.getDeclaredAnnotations();
          for (Annotation anno : annotations) {
              if (anno instanceof RequireProfile) {
                  RequireProfile profile = (RequireProfile) anno;
                  if (!matches(profile)) {
                      return false;
                  }
              } else if (anno instanceof RequireMode) {
                  RequireMode mode = (RequireMode) anno;
                  if (!matches(mode)) {
                      return false;
                  }
              } else if (anno instanceof RequireGroup) {
                  RequireGroup group = (RequireGroup) anno;
                  if (!matches(group)) {
                      return false;
                  }
              } else if (anno instanceof Profile) {
                  Profile profile = (Profile)anno;
                  if (!matches(profile)) {
                      return false;
                  }
              } else if (anno instanceof Group) {
                  Group group = (Group) anno;
                  if (!matches(group)) {
                      return false;
                  }
              } else if (anno instanceof Mode) {
                  Mode mode = (Mode) anno;
                  if (!matches(mode)) {
                      return false;
                  }
              }
          }
          return true;
      }
docs: Determine if an {@link AnnotatedElement} has environment annotations and if it has then check
  if all environment annotations matches the current executing environment
  @param annotatedElement an annotated element
  @return `true` if the element does not have environment annotations or all environment annotations matches