private static boolean checkAnnotations(Class<?> candidate, List<Class<?>> selectors) {
    LOGGER.debug("Checking annotations for: [{}]", candidate);
    boolean ret = false;
    for (Annotation candidateAnn : candidate.getDeclaredAnnotations()) {
      if (selectors.contains(candidateAnn.annotationType())) {
        ret = true;
        break;
      }
    }
    return ret;
  }
Checks if the candidate has annotations listed in the selection criteria

@param candidate the type to be checked
@return true if the candidate has annotations listed in the selection criteria, false otherwise
ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java