ServerPortRegistry { public static void addService( Service service ) { if ( !services.contains( service.getServiceName() ) ) { services.put( service.getServiceName(), service ); } } private  ServerPortRegistry(); static void addPort( ServerPort serverPort ); static void addService( Service service ); static void removePort( ServerPort serverPort ); static void clear(); static Service getService( String serviceName ); static ServerPort getPort( String portId ); static Set<Service> getServices(); static Set<ServerPort> getPorts();  }
@Test public void addServiceTest() { ServerPortRegistry.clear(); Service service = new Service( "foo", "foo description" ); ServerPortRegistry.addService( service ); Service readService = ServerPortRegistry.getService( "foo" ); assertEquals( service.getServiceDescription(), readService.getServiceDescription() ); }