### Question:
TransformationMap { public List<SocketPortAllocation> getHostServerSocketPorts( String hostname ) { List<SocketPortAllocation> ports = hostServerSocketPortsMap.get( hostname ); return ports == null ? Collections.emptyList() : Collections.unmodifiableList( ports ); } TransformationMap(); void addTransformation( String transformationName, String containerObjectId, Trans trans,
    TransConfiguration transConfiguration ); void registerTransformation( Trans trans, TransConfiguration transConfiguration ); Trans getTransformation( String transformationName ); Trans getTransformation( CarteObjectEntry entry ); TransConfiguration getConfiguration( String transformationName ); TransConfiguration getConfiguration( CarteObjectEntry entry ); void removeTransformation( CarteObjectEntry entry ); List<CarteObjectEntry> getTransformationObjects(); SocketPortAllocation allocateServerSocketPort( int portRangeStart, String hostname,
    String clusteredRunId, String transformationName, String sourceSlaveName, String sourceStepName,
    String sourceStepCopy, String targetSlaveName, String targetStepName, String targetStepCopy ); void deallocateServerSocketPorts( String transName, String carteObjectId ); void deallocateServerSocketPorts( CarteObjectEntry entry ); void deallocateServerSocketPort( int port, String hostname ); CarteObjectEntry getFirstCarteObjectEntry( String transName ); SlaveServerConfig getSlaveServerConfig(); void setSlaveServerConfig( SlaveServerConfig slaveServerConfig ); List<SocketPortAllocation> getHostServerSocketPorts( String hostname ); SlaveSequence getSlaveSequence( String name ); boolean isAutomaticSlaveSequenceCreationAllowed(); SlaveSequence createSlaveSequence( String name );  }### Answer:
@Test public void getHostServerSocketPorts() { transformationMap.allocateServerSocketPort( 1, TEST_HOST, CLUSTERED_RUN_ID, TEST_TRANSFORMATION_NAME, TEST_SOURCE_SLAVE_NAME, TEST_SOURCE_STEP_NAME, TEST_SOURCE_STEP_COPY, TEST_TARGET_SLAVE_NAME, TEST_TARGET_STEP_NAME, TEST_TARGET_STEP_COPY ); List<SocketPortAllocation> actualResult = transformationMap.getHostServerSocketPorts( TEST_HOST ); assertNotNull( actualResult ); assertEquals( 1, actualResult.size() ); }
@Test public void getHostServerSocketPortsWithoutAllocatedPorts() { List<SocketPortAllocation> actualResult = transformationMap.getHostServerSocketPorts( TEST_HOST ); assertNotNull( actualResult ); assertTrue( actualResult.isEmpty() ); }