### Question:
IssueReporterFactory { public static IssueReporter newInstance(String id) { ServiceLoader<IssueReporter> serviceLoader = ServiceLoader.load(IssueReporter.class); Iterator<IssueReporter> services = serviceLoader.iterator(); while (services.hasNext()) { IssueReporter reporter = services.next(); if (reporter.getId().equals(id)) { return reporter; } } throw new IllegalArgumentException("Unknown issue reporter: " + id); } private  IssueReporterFactory(); static IssueReporter newInstance(String id);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void throwsExceptionOnUnknownId() { IssueReporterFactory.newInstance(id); }