ExampleVirusScanner extends ComponentSupport implements VirusScanner { public boolean hasVirus(final StorageFileItem item) { return item.getName().contains("infected"); }  boolean hasVirus(final StorageFileItem item);  }
@Test public void nonInfectedItem() throws Exception { StorageFileItem item = mock(StorageFileItem.class); when(item.getName()).thenReturn("some-clean-item"); assertThat(underTest.hasVirus(item), is(false)); }
@Test public void infectedItem() throws Exception { StorageFileItem item = mock(StorageFileItem.class); when(item.getName()).thenReturn("some-infected-item"); assertThat(underTest.hasVirus(item), is(true)); }