### Question:
AbstractHttpExecutable extends AbstractClientTransport { protected int extractPortFromAddress() throws IOException { String remoteAddress = remoteAddressRef.get(); if (remoteAddress == null || remoteAddress.equals("NOT ASSIGNED")) { throw new IllegalArgumentException("Remote address not set!"); } URL url = new URL(remoteAddress); return url.getPort(); } protected  AbstractHttpExecutable(final HttpServiceBindingDescriptor bindingDescriptor,
                                  CougarRequestFactory<HR> requestFactory,
                                  Tracer tracer); void init(); @Override void execute(final ExecutionContext ctx, final OperationKey key, final Object[] args,
                        final ExecutionObserver obs, final ExecutionVenue executionVenue, final TimeConstraints timeConstraints); @ManagedAttribute(description = REMOTE_ADDRESS_DESCRIPTION) void setRemoteAddress(final String host); @ManagedAttribute(description = REMOTE_ADDRESS_DESCRIPTION) String getRemoteAddress(); @ManagedAttribute(description = SERVICE_CONTEXT_PATH_DESCRIPTION) String getServiceContextPath(); abstract TransportMetrics getTransportMetrics(); void setDataBindingFactory(DataBindingFactory dataBindingFactory); void setQueryStringGeneratorFactory(QueryStringGeneratorFactory queryStringGeneratorFactory); void setIdentityTokenResolver(IdentityTokenResolver<HR, HR, X509Certificate[]> identityTokenResolver); void setExceptionTransformer(ExceptionTransformer exceptionTransformer); void setExceptionFactory(ExceptionFactory exceptionFactory); void setTransportSSLEnabled(boolean transportSSLEnabled); void setHttpsKeyPassword(String httpsKeyPassword); void setHttpsKeystore(Resource httpsKeystore); void setHttpsKeystoreType(String httpsKeystoreType); void setHttpsTrustPassword(String httpsTrustPassword); void setHttpsTruststore(Resource httpsTruststore); void setHttpsTruststoreType(String httpsTruststoreType); void setConnectTimeout(int timeout); void setIdleTimeout(int idleTimeout); void setHostnameVerificationDisabled(final boolean hostnameVerificationDisabled); void setRequestFactory(CougarRequestFactory<HR> requestFactory); @ManagedAttribute int getIdleTimeout(); @ManagedAttribute int getConnectTimeout(); @ManagedAttribute String getHttpsTruststoreType(); @ManagedAttribute Resource getHttpsTruststore(); @ManagedAttribute String getHttpsKeystoreType(); @ManagedAttribute Resource getHttpsKeystore(); @ManagedAttribute boolean isHostnameVerificationDisabled(); @ManagedAttribute boolean isTransportSSLEnabled(); @ManagedAttribute boolean isHardFailEnumDeserialisation(); void setHardFailEnumDeserialisation(boolean hardFailEnumDeserialisation); @ManagedAttribute boolean isGzipCompressionEnabled(); @ManagedAttribute void setGzipCompressionEnabled(boolean gzipCompressionEnabled);  }### Answer:
@Test public void testExtractPortFromAddress() throws IOException { HttpClientExecutable executable = new HttpClientExecutable(null, new HttpContextEmitter(new DefaultGeoLocationSerializer(),"X-REQUEST-UUID","X-REQUEST-UUID-PARENTS"),tracer); executable.setRemoteAddress("http: int actual = executable.extractPortFromAddress(); assertEquals(3939, actual); executable.setRemoteAddress("http: actual = executable.extractPortFromAddress(); assertEquals(25000, actual); }