@Test public void testGetByQualifier() { Annotation qualifier = mock(Annotation.class); final ImageStrip[] result = tested.get(qualifier); assertEquals(1, result.length); assertEquals(strip, result[0]); verify(stripInstances, times(1)).select(eq(qualifier)); }
public ImageStrip get(final String name) { return StreamSupport.stream(stripInstances.spliterator(), false) .filter(strip -> getName(strip).equals(name)) .findAny() .get(); }
ImageStripRegistry { public ImageStrip get(final String name) { return StreamSupport.stream(stripInstances.spliterator(), false) .filter(strip -> getName(strip).equals(name)) .findAny() .get(); } }
ImageStripRegistry { public ImageStrip get(final String name) { return StreamSupport.stream(stripInstances.spliterator(), false) .filter(strip -> getName(strip).equals(name)) .findAny() .get(); } protected  ImageStripRegistry(); @Inject  ImageStripRegistry(final @Any ManagedInstance<ImageStrip> stripInstances); }
ImageStripRegistry { public ImageStrip get(final String name) { return StreamSupport.stream(stripInstances.spliterator(), false) .filter(strip -> getName(strip).equals(name)) .findAny() .get(); } protected  ImageStripRegistry(); @Inject  ImageStripRegistry(final @Any ManagedInstance<ImageStrip> stripInstances); ImageStrip get(final String name); ImageStrip get(final Class<? extends ImageStrip> stripType); ImageStrip[] get(final Annotation... qualifiers); @PreDestroy void destroy(); @SuppressWarnings("unchecked") static String getName(final ImageStrip strip); static String getName(final Class<? extends ImageStrip> stripType); }
ImageStripRegistry { public ImageStrip get(final String name) { return StreamSupport.stream(stripInstances.spliterator(), false) .filter(strip -> getName(strip).equals(name)) .findAny() .get(); } protected  ImageStripRegistry(); @Inject  ImageStripRegistry(final @Any ManagedInstance<ImageStrip> stripInstances); ImageStrip get(final String name); ImageStrip get(final Class<? extends ImageStrip> stripType); ImageStrip[] get(final Annotation... qualifiers); @PreDestroy void destroy(); @SuppressWarnings("unchecked") static String getName(final ImageStrip strip); static String getName(final Class<? extends ImageStrip> stripType);  }