### Question:
StompServerAdapterFactory { public static StompServerAdapter create(StompConnection connection, String server) { StompServerAdapter result = null; String[] parts = server.split("/"); if (parts.length == 0) { result = new GenericStompServerAdaptor(connection); } else { String serverName = parts[0]; String version = ""; if (parts.length > 1) { version = parts[1]; } try { StompServerAdapterFactory factory = findProviderFactory(serverName); result = factory.createAdapter(connection, serverName, version); } catch (Exception ex) { LOG.error("Failed to create StompServerAdapter instance for: {}", serverName); LOG.trace("Error: ", ex); result = new GenericStompServerAdaptor(connection); } } return result; }  abstract StompServerAdapter createAdapter(StompConnection connection, String server, String version); abstract String getName(); static StompServerAdapter create(StompConnection connection, String server); static StompServerAdapterFactory findProviderFactory(String server);  }### Answer:
@Test public void testCreateServerAdapter() { StompServerAdapter adapter = StompServerAdapterFactory.create(connection, "ActiveMQ"); assertNotNull(adapter); assertEquals("ActiveMQ", adapter.getServerName()); }
@Test public void testUnknownCreatesGenericAdapter() { StompServerAdapter adapter = StompServerAdapterFactory.create(connection, "Unknown"); assertNotNull(adapter); assertEquals("Generic", adapter.getServerName()); }