assertEquals("C3", publishers.get(2).getCategory() + publishers.get(2).getServiceName());
assertEquals(null, publishers.get(2).getContractPublisher());
assertEquals("D4", publishers.get(3).getCategory() + publishers.get(3).getServiceName());
assertTrue(publishers.get(3).getContractPublisher() instanceof MockContractPublisher);
assertEquals("A1", 1, ServicePublisher.getServicePublishers(new Service("A", "1")).size()) ;
assertEquals("B2", 1, ServicePublisher.getServicePublishers(new Service("B", "2")).size()) ;
assertEquals("C3", 1, ServicePublisher.getServicePublishers(new Service("C", "3")).size()) ;
assertEquals("D4", 1, ServicePublisher.getServicePublishers(new Service("D", "4")).size()) ;
assertEquals("Service count", 4, ServicePublisher.getServices().size());
final ESBServiceContractReferencePublisher publisher = new ESBServiceContractReferencePublisher(new Service("C", "3"), "test", "endpoint") ;
ServicePublisher.addContractReferencePublishers(controller2, Arrays.asList(publisher)) ;
assertEquals("C3", 2, ServicePublisher.getServicePublishers(new Service("C", "3")).size()) ;
assertEquals("Service count", 4, ServicePublisher.getServices().size());
ServicePublisher.removeServicePublishers(controller1);
publishers = ServicePublisher.getServicePublishers();
assertEquals(3, publishers.size());
assertEquals("C3", publishers.get(0).getCategory() + publishers.get(0).getServiceName());
assertEquals(null, publishers.get(0).getContractPublisher());
assertEquals("C3", publishers.get(1).getCategory() + publishers.get(1).getServiceName());
assertTrue("ContractReferencePublisher", publishers.get(1).getPublisher() instanceof ContractReferencePublisher);
assertEquals("D4", publishers.get(2).getCategory() + publishers.get(2).getServiceName());
assertTrue(publishers.get(2).getContractPublisher() instanceof MockContractPublisher);
assertEquals("Service count", 2, ServicePublisher.getServices().size());
assertEquals("A1", 0, ServicePublisher.getServicePublishers(new Service("A", "1")).size()) ;
assertEquals("B2", 0, ServicePublisher.getServicePublishers(new Service("B", "2")).size()) ;
assertEquals("C3", 2, ServicePublisher.getServicePublishers(new Service("C", "3")).size()) ;
assertEquals("D4", 1, ServicePublisher.getServicePublishers(new Service("D", "4")).size()) ;
ServicePublisher.removeServicePublishers(controller2) ;
}