RSConfig extends Application { @Override public Set<Class<?>> getClasses() { Set<Class<?>> resources = getHashSet(); addRestResourceClasses(resources); return resources; }  @Override Set<Class<?>> getClasses();  }
@Test public void testGetClasses() { System.out.println("getClasses"); Set<Class<?>> resources = mock(Set.class); doReturn(resources).when(instance).getHashSet(); doNothing().when(instance).addRestResourceClasses(eq(resources)); Set<Class<?>> result = instance.getClasses(); assertThat(result).isEqualTo(resources); }