### Question:
MetricVisitor extends TreeVisitor<InputFileContext> { public Set<Integer> nosonarLines() { return nosonarLines; } MetricVisitor(FileLinesContextFactory fileLinesContextFactory, NoSonarFilter noSonarFilter); static boolean isNosonarComment(Comment comment); Set<Integer> linesOfCode(); Set<Integer> commentLines(); Set<Integer> nosonarLines(); Set<Integer> executableLines(); int numberOfFunctions(); int numberOfClasses(); int cognitiveComplexity(); static final String NOSONAR_PREFIX; }### Answer:
@Test public void nosonarLines() throws Exception { scan("" + "x + 1;\n" + " "fun function1() { "x = true || false; }"); assertThat(visitor.nosonarLines()).containsExactly(2); Set<Integer> nosonarLines = new HashSet<>(); nosonarLines.add(2); verify(mockNoSonarFilter).noSonarInFile(inputFile, nosonarLines); }