HashEmbedderFactory implements EmbedderFactory { @Override public final Embedder get(final URL url) { if (imageEmbedder == null) { imageEmbedder = new ImageEmbedder(messageDigest); } return imageEmbedder; } @Inject  HashEmbedderFactory(final MessageDigest messageDigest); @Override final Embedder get(final URL url);  }
@Test public void get_SameExpImageNodeParameterTwice_ReturnsSameImageEmbedder() throws MalformedURLException { URL url = new URL("http: Embedder result = factory.get(url); Embedder result2 = factory.get(url); assertNotNull(result); assertSame(result, result2); }