private static void visitSuppressWarnings(SourceCode sourceCode, Set<Integer> ignoredLines) {
    if ((sourceCode instanceof SourceClass && ((SourceClass) sourceCode).isSuppressWarnings())
        || (sourceCode instanceof SourceMethod
            && ((SourceMethod) sourceCode).isSuppressWarnings())) {
      visitLines(sourceCode, ignoredLines);
    }

    if (sourceCode.hasChildren()) {
      for (SourceCode child : sourceCode.getChildren()) {
        visitSuppressWarnings(child, ignoredLines);
      }
    }
  }
 @Override
 public boolean match(SourceCode unit) {
   return unit.isType(resourceType);
 }
 private static void visitLines(SourceCode sourceCode, Set<Integer> ignoredLines) {
   for (int line = sourceCode.getStartAtLine(); line <= sourceCode.getEndAtLine(); line++) {
     ignoredLines.add(line);
   }
 }