### Question:
EJBEndpoint { public int getAddressPort(String address) { int index = address.lastIndexOf(':'); int end = address.lastIndexOf('/'); if (index == 4) { return DEFAULT_HTTP_PORT; } if (end < index) { return Integer.parseInt(address.substring(index + 1)); } return Integer.parseInt(address.substring(index + 1, end)); } EJBEndpoint(EJBServantConfig ejbConfig); Server publish(); String getServiceClassName(); String getDefaultEJBServantBaseURL(); int getAddressPort(String address); String getEjbServantBaseURL(); void setEjbServantBaseURL(String ejbServantBaseURL); WorkManager getWorkManager(); void setWorkManager(WorkManager workManager);  }### Answer:
@Test public void testGetAddressPort() throws Exception { int port = endpoint.getAddressPort("http: assertEquals(8080, port); }
@Test public void testGetAddress80Port() throws Exception { int port = endpoint.getAddressPort("http: assertEquals(80, port); }
@Test public void testGetAddressEndPort() throws Exception { int port = endpoint.getAddressPort("http: assertEquals(9999, port); }