public NetworkConfig setPortCount(int portCount) {
        if (portCount < 1) {
            throw new IllegalArgumentException("port count can't be smaller than 0");
        }
        this.portCount = portCount;
        return this;
    }
@Test(expected = IllegalArgumentException.class)
    public void testNegativePortCount() {
        int portCount = -1;
        networkConfig.setPortCount(portCount);
    }