### Question:
UpnpNatManager extends AbstractNatManager { public void requestPortForward( final int port, final NetworkProtocol protocol, final NatServiceType serviceType) { checkState(isStarted(), "Cannot call requestPortForward() when in stopped state"); checkArgument(port != 0, "Cannot map to internal port zero."); this.requestPortForward( new PortMapping( true, new UnsignedIntegerFourBytes(0), null, new UnsignedIntegerTwoBytes(port), new UnsignedIntegerTwoBytes(port), null, toJupnpProtocol(protocol), serviceType.getValue())); } UpnpNatManager();   UpnpNatManager(final UpnpService service); @Override synchronized void doStart(); @Override synchronized void doStop(); @Override CompletableFuture<String> retrieveExternalIPAddress(); @Override CompletableFuture<List<NatPortMapping>> getPortMappings(); void requestPortForward(
      final int port, final NetworkProtocol protocol, final NatServiceType serviceType);  }### Answer:
@Test public void requestPortForwardThrowsWhenCalledBeforeStart() throws Exception { assertThatThrownBy( () -> { upnpManager.requestPortForward(80, NetworkProtocol.TCP, NatServiceType.DISCOVERY); }) .isInstanceOf(IllegalStateException.class); }
@Test public void requestPortForwardThrowsWhenPortIsZero() throws NatInitializationException { upnpManager.start(); assertThatThrownBy( () -> upnpManager.requestPortForward(0, NetworkProtocol.TCP, NatServiceType.DISCOVERY)) .isInstanceOf(IllegalArgumentException.class); }