### Question:
ComponentScanner { public void scanForPackage(final Package source) { Objects.requireNonNull(source, "source package cannot be null"); scanForPackage(source.getName()); } ComponentScanner(final ComponentRegistry registry); void scan(final String componentPaths); void scan(final List<String> componentPaths); void scanForPackage(final Package source); void scanForPackage(final String source);  }### Answer:
@Test @SuppressWarnings("unchecked") public void shouldScanAndRegisterDeclaredSingletonFactory() { scanner.scanForPackage(TestAnnotatedFactory.class.getPackage()); Mockito.verify(factory).registerSingleton( Mockito.eq("testSingleton"), Mockito.argThat(new ClassMatcher(TestAnnotatedFactory.DummyComponent.class)), Mockito.any(Supplier.class)); }