### Question:
WSDLManagerImpl implements WSDLManager { @Override public void removeDefinition(Definition wsdl) { synchronized (definitionsMap) { List<Object> keys = new ArrayList<>(); for (Map.Entry<Object, Definition> e : definitionsMap.entrySet()) { if (e.getValue() == wsdl) { keys.add(e.getKey()); } } for (Object o : keys) { definitionsMap.remove(o); schemaCacheMap.remove(o); } } } WSDLManagerImpl(); private  WSDLManagerImpl(Bus b); @Resource final void setBus(Bus b); WSDLFactory getWSDLFactory(); Map<Object, Definition> getDefinitions(); ExtensionRegistry getExtensionRegistry(); Definition getDefinition(String url); Definition getDefinition(final Element el); void addDefinition(Object key, Definition wsdl); void setXMLStreamReaderWrapper(XMLStreamReaderWrapper wrapper); ServiceSchemaInfo getSchemasForDefinition(Definition wsdl); void putSchemasForDefinition(Definition wsdl, ServiceSchemaInfo schemas); boolean isDisableSchemaCache(); void setDisableSchemaCache(boolean disableSchemaCache); @Override void removeDefinition(Definition wsdl); @Override void removeDefinition(String url);  }### Answer:
@Test public void testRemoveDefinition() throws Exception { String basedir = System.getProperty("basedir"); if (basedir == null) { basedir = new File(".").getCanonicalPath(); } Path path1 = FileSystems.getDefault().getPath(basedir, "/src/test/resources/org/apache/cxf/wsdl11/hello_world.wsdl"); Path path2 = FileSystems.getDefault().getPath(basedir, "/target/test-classes/hello_world2.wsdl"); Files.copy(path1, path2); WSDLManager builder = new WSDLManagerImpl(); Definition def = builder.getDefinition(path2.toString()); assertNotNull(def); Files.delete(path2); def = builder.getDefinition(path2.toString()); assertNotNull(def); Map<?, ?> services = def.getServices(); assertNotNull(services); assertEquals(1, services.size()); String qname = "http: Service service = (Service) services.get(new QName(qname, "SOAPService")); assertNotNull(service); builder.removeDefinition(def); try { builder.getDefinition(path2.toString()); fail("Failure expected"); } catch (NullPointerException ex) { } }