@Test public void numberOfCalls() { Set<String> actual = new HashSet<>(); actual.addAll(first.getInstances(String.class).getList()); actual.addAll(second.getInstances(String.class).getList()); Set<String> expected = IntStream.range(0, 14).mapToObj(i -> "String: " + i).collect(toSet()); assertEquals(expected, actual); }
@NotNull public <T> Instances<T> getInstances(Class<T> type) { return getInstances(Key.of(type)); }
WorkerPool { @NotNull public <T> Instances<T> getInstances(Class<T> type) { return getInstances(Key.of(type)); } }
WorkerPool { @NotNull public <T> Instances<T> getInstances(Class<T> type) { return getInstances(Key.of(type)); } WorkerPool(Injector injector, int id, Scope scope, int workers); }
WorkerPool { @NotNull public <T> Instances<T> getInstances(Class<T> type) { return getInstances(Key.of(type)); } WorkerPool(Injector injector, int id, Scope scope, int workers); int getId(); Scope getScope(); @NotNull Instances<T> getInstances(Class<T> type); @NotNull Instances<T> getInstances(Key<T> key); @Nullable Instances<T> peekInstances(Class<T> type); @Nullable Instances<T> peekInstances(Key<T> key); @NotNull Map<Key<?>, Instances<?>> peekInstances(); Injector[] getScopeInjectors(); int getSize(); @Override String toString(); }
WorkerPool { @NotNull public <T> Instances<T> getInstances(Class<T> type) { return getInstances(Key.of(type)); } WorkerPool(Injector injector, int id, Scope scope, int workers); int getId(); Scope getScope(); @NotNull Instances<T> getInstances(Class<T> type); @NotNull Instances<T> getInstances(Key<T> key); @Nullable Instances<T> peekInstances(Class<T> type); @Nullable Instances<T> peekInstances(Key<T> key); @NotNull Map<Key<?>, Instances<?>> peekInstances(); Injector[] getScopeInjectors(); int getSize(); @Override String toString();  }