ApplicationRegistry { public Application getApplication(String id) { if (!isRegistered(id)) { throw new IllegalArgumentException("Application with ID " + id + " is not registered"); } return registry.get(id); }  Application register(Application app); boolean isRegistered(String id); List<Application> getApplications(); Application getApplication(String id);  }
@Test public void getApplication() throws Exception { Application app = new Application(); app.setId("abc"); app.setUrl("http: registry.register(app); assertEquals(app, registry.getApplication("abc")); }