@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); }
@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; }
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; } }
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); }
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); }
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);  }