@Test public void should_store_nosonar_lines_on_inputfile() { DefaultInputFile f = TestInputFileBuilder.create("module1", "myfile.java").build(); new NoSonarFilter().noSonarInFile(f, new HashSet<>(Arrays.asList(1,4))); assertThat(f.hasNoSonarAt(1)).isTrue(); assertThat(f.hasNoSonarAt(2)).isFalse(); assertThat(f.hasNoSonarAt(4)).isTrue(); } }