### Question:
NettyServer extends AbstractServer { @Override public boolean isBound() { return serverChannel.isOpen() && serverChannel.isActive(); } NettyServer(ProviderConfig providerConfig); @Override boolean isBound(); @Override void doClose(); @Override Set<Channel> getChannels();  }### Answer:
@Test public void testBindPort() { Server server1 = null; Server server2 = null; ProviderConfig providerConfig = genProviderConfig(); try { server1 = serverFactory.buildServer(providerConfig); Assert.assertTrue(server1.isBound()); server2 = serverFactory.buildServer(providerConfig); Assert.fail(); } catch (TransportException e) { Assert.assertTrue(e.getMessage().contains(String.valueOf(PORT))); } catch (Exception e) { Assert.fail("Must be TransportException"); } try { server1.close(); Assert.assertFalse(server1.isBound()); Assert.assertTrue(server1.isClosed()); server2 = serverFactory.buildServer(providerConfig); Assert.assertTrue(server2.isBound()); server2.close(); server2.close(); } catch (Exception e) { Assert.fail(); } }