AnalysisWarningsWrapper { public void addUnique(String text) { this.analysisWarnings.addUnique(text); } AnalysisWarningsWrapper(AnalysisWarnings analysisWarnings); void addUnique(String text); static final AnalysisWarningsWrapper NOOP_ANALYSIS_WARNINGS; }
@Test void delegate_to_analysisWarnings() { AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class); AnalysisWarningsWrapper wrapper = new AnalysisWarningsWrapper(analysisWarnings); String warning = "some warning"; wrapper.addUnique(warning); verify(analysisWarnings).addUnique(warning); }