@Test(expected = LinkageError.class) public void testNonsense() { SingleProviderResolver.resolveMandatory(Integer.class); }
public static <T> T resolveMandatory(Class<T> c) { T obj = resolve(c); if (obj == null) { Error err = new LinkageError("No implementation found for: " + c.getName()); throw err; } return obj; }
SingleProviderResolver { public static <T> T resolveMandatory(Class<T> c) { T obj = resolve(c); if (obj == null) { Error err = new LinkageError("No implementation found for: " + c.getName()); throw err; } return obj; } }
SingleProviderResolver { public static <T> T resolveMandatory(Class<T> c) { T obj = resolve(c); if (obj == null) { Error err = new LinkageError("No implementation found for: " + c.getName()); throw err; } return obj; }  }
SingleProviderResolver { public static <T> T resolveMandatory(Class<T> c) { T obj = resolve(c); if (obj == null) { Error err = new LinkageError("No implementation found for: " + c.getName()); throw err; } return obj; }  static T resolveMandatory(Class<T> c); static T resolve(Class<T> c); @SuppressWarnings("unchecked") static synchronized T resolve(Class<T> c, Class<? extends T> defaultImpl); }
SingleProviderResolver { public static <T> T resolveMandatory(Class<T> c) { T obj = resolve(c); if (obj == null) { Error err = new LinkageError("No implementation found for: " + c.getName()); throw err; } return obj; }  static T resolveMandatory(Class<T> c); static T resolve(Class<T> c); @SuppressWarnings("unchecked") static synchronized T resolve(Class<T> c, Class<? extends T> defaultImpl);  }