Lint implements TestRule { public List<Warning> project(TestFile... files) throws Exception { wrapper.analyze(detector, Arrays.asList(issues), files); return wrapper.getWarnings(); } Lint(@NonNull Detector detector, @NonNull Issue... issues); @Override Statement apply(Statement base, Description description); List<Warning> files(@NonNull String... files); List<Warning> project(TestFile... files);  }
@Test public void shouldAnalyzeInlineResourceAndReturnWarnings() throws Exception { TestFile[] files = { xml("file1", "<xml></xml>"), java("file2", "public class Class{}") }; Detector detector = Helper.dummyDetector(); Issue[] issues = { Helper.dummyIssue() }; Lint lint = new Lint(detector, issues); List<Warning> warnings = lint.project(files); assertThat(warnings).isEqualTo(Helper.dummyWarnings()); }