### Question:
JaxrsApplicationScanner extends JaxrsAnnotationScanner<JaxrsApplicationScanner> { @Override public Set<Class<?>> classes() { Set<Class<?>> output = new HashSet<>(); if (application != null) { Set<Class<?>> clzs = application.getClasses(); if (clzs != null) { for (Class<?> clz : clzs) { if (!isIgnored(clz.getName())) { output.add(clz); } } } Set<Object> singletons = application.getSingletons(); if (singletons != null) { for (Object o : singletons) { if (!isIgnored(o.getClass().getName())) { output.add(o.getClass()); } } } } return output; }  @Override Set<Class<?>> classes();  }### Answer:
@Test(description = "scan classes from Application only") public void shouldScanClassesApplicationOnly() throws Exception { assertEquals(scanner.classes().size(), 1); assertTrue(scanner.classes().contains(ResourceInPackageA.class)); }
@Test(description = "scan classes from the Application only, ignoring resource packages") public void shouldScanClassesFromApplicationOnlyIgnoringResourcePackages() throws Exception { SwaggerConfiguration openApiConfiguration = new SwaggerConfiguration(); openApiConfiguration.setResourcePackages(Collections.singleton("com.my.project.resources")); scanner.setConfiguration(openApiConfiguration); assertEquals(scanner.classes().size(), 1); assertTrue(scanner.classes().contains(ResourceInPackageA.class)); }
@Test(description = "scan classes from Application when is not set") public void shouldScanForClassesWhenApplicationNotSet() throws Exception { scanner.application(null); assertTrue(scanner.classes().isEmpty()); }