@Test
public void testGeneratePortForwardingRulePair() {

    final NatRule[] rules = resource.generatePortForwardingRulePair("10.10.10.10", new int[] { 8080, 8080 }, "11.11.11.11", new int[] { 80, 80 }, "tcp");
    assertTrue("DestinationNatRule".equals(rules[0].getType()));
    assertTrue("SourceNatRule".equals(rules[1].getType()));
    final DestinationNatRule dnr = (DestinationNatRule) rules[0];
    assertTrue(dnr.getToDestinationIpAddress().equals("10.10.10.10"));
    assertTrue(dnr.getToDestinationPort() == 8080);
    assertTrue(dnr.getMatch().getDestinationIpAddresses().equals("11.11.11.11"));
    assertTrue(dnr.getMatch().getDestinationPort() == 80);
    assertTrue(dnr.getMatch().getEthertype().equals("IPv4") && dnr.getMatch().getProtocol() == 6);
    final SourceNatRule snr = (SourceNatRule) rules[1];
    assertTrue(snr.getToSourceIpAddressMin().equals("11.11.11.11") && snr.getToSourceIpAddressMax().equals("11.11.11.11"));
    assertTrue(snr.getToSourcePort() == 80);
    assertTrue(snr.getMatch().getSourceIpAddresses().equals("10.10.10.10"));
    assertTrue(snr.getMatch().getSourcePort() == 8080);
    assertTrue(snr.getMatch().getEthertype().equals("IPv4") && rules[1].getMatch().getProtocol() == 6);
}