### Question:
FetcherManagerBase { @Nullable public Fetcher<T> findFetcher(@NonNull final T serviceUri) { checkNotNull(serviceUri); for (Fetcher<T> fetcher : fetchers) { if (fetcher.getServiceUri().equals(serviceUri)) { return fetcher; } } return null; } protected  FetcherManagerBase(@NonNull final Collection<Fetcher<T>> fetchers); @Nullable Fetcher<T> findFetcher(@NonNull final T serviceUri);  }### Answer:
@Test public void testFindFetcher() { final Fetcher<String> fetcher = mock(Fetcher.class); when(fetcher.getServiceUri()).thenReturn("path/to/resource"); final FetcherManagerBase<String> fetcherManager = new TestFetcherManager(Collections.singletonList(fetcher)); Fetcher<String> foundFetcher = fetcherManager.findFetcher("path/to/resource"); assertEquals(fetcher, foundFetcher); }
@Test public void testFindFetcherNull() { final FetcherManagerBase<String> fetcherManager = new TestFetcherManager(Collections.emptyList()); Fetcher<String> foundFetcher = fetcherManager.findFetcher("path/to/resource"); assertNull(foundFetcher); }