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