### Question:
DevicePrintService { public DevicePrint getDevicePrint(HttpServletRequest request) { DevicePrint devicePrint = new DevicePrint(); for (Extractor extractor : extractorFactory.getExtractors()) { extractor.extractData(devicePrint, request); } return devicePrint; } DevicePrintService(DevicePrintAuthenticationConfig devicePrintAuthenticationConfig,
            UserProfilesDao userProfilesDao, DevicePrintExtractorFactory extractorFactory,
            DevicePrintComparator devicePrintComparator); boolean hasRequiredAttributes(DevicePrint devicePrint); DevicePrint getDevicePrint(HttpServletRequest request); UserProfile getBestMatchingUserProfile(DevicePrint devicePrint); void createNewProfile(DevicePrint devicePrint); void updateProfile(UserProfile profile, DevicePrint devicePrint);  }### Answer:
@Test public void shouldGetCurrentDevicePrint() { HttpServletRequest request = mock(HttpServletRequest.class); Set<Extractor> extractors = new HashSet<Extractor>(); Extractor extractorOne = mock(Extractor.class); Extractor extractorTwo = mock(Extractor.class); given(extractorFactory.getExtractors()).willReturn(extractors); extractors.add(extractorOne); extractors.add(extractorTwo); DevicePrint devicePrint = devicePrintService.getDevicePrint(request); verify(extractorOne).extractData(Matchers.<DevicePrint>anyObject(), eq(request)); verify(extractorTwo).extractData(Matchers.<DevicePrint>anyObject(), eq(request)); assertNotNull(devicePrint); }