@Before
  public void setup() throws Exception {
    this.server = new EchoServer(18283);
    this.server.start();
    Properties props = new Properties();
    props.setProperty("selector.executor.pool.size", Integer.toString(selectorExecutorPoolSize));
    VerifiableProperties vprops = new VerifiableProperties(props);
    NetworkConfig networkConfig = new NetworkConfig(vprops);
    this.selector =
        new Selector(new NetworkMetrics(new MetricRegistry()), SystemTime.getInstance(), null, networkConfig);
  }
A set of tests for the selector. These use a test harness that runs a simple socket server that echos back responses.
ambry-network/src/test/java/com/github/ambry/network/SelectorTest.java