### Question:
Convert { public static ServerInstanceKey toKey( final ServerInstance serverInstance ) { return new ServerInstanceKey( serverInstance.getServerTemplateId(), serverInstance.getServerName(), serverInstance.getServerInstanceId(), serverInstance.getUrl() ); } private  Convert(); static ServerInstanceKey toKey( final ServerInstance serverInstance );  }### Answer:
@Test public void testToKey() { final String serverTemplateId = "serverTemplateId"; final String serverName = "serverName"; final String serverInstanceId = "serverInstanceId"; final String url = "url"; ServerInstance serverInstance = new ServerInstance( serverTemplateId, serverName, serverInstanceId, url, "version", new ArrayList<Message>(), new ArrayList<Container>() ); ServerInstanceKey key = Convert.toKey( serverInstance ); assertEquals( serverTemplateId, key.getServerTemplateId() ); assertEquals( serverName, key.getServerName() ); assertEquals( serverInstanceId, key.getServerInstanceId() ); assertEquals( url, key.getUrl() ); }