@Test public void testDstMatchToThen() { Prefix p1 = Prefix.parse("1.1.1.1/24"); NatRuleMatch dstMatch = new NatRuleMatchDstAddr(p1); assertThat( ReverseStaticNat.reverseMatchToThen(dstMatch), equalTo(new NatRuleThenPrefix(p1, SOURCE))); String prefixName = "prefix"; dstMatch = new NatRuleMatchDstAddrName(prefixName); assertThat( ReverseStaticNat.reverseMatchToThen(dstMatch), equalTo(new NatRuleThenPrefixName(prefixName, SOURCE))); dstMatch = new NatRuleMatchDstPort(100, 200); assertNull(ReverseStaticNat.reverseMatchToThen(dstMatch)); dstMatch = new NatRuleMatchSrcAddr(p1); assertNull(ReverseStaticNat.reverseMatchToThen(dstMatch)); dstMatch = new NatRuleMatchSrcAddrName(prefixName); assertNull(ReverseStaticNat.reverseMatchToThen(dstMatch)); dstMatch = new NatRuleMatchSrcPort(10000, 30000); assertNull(ReverseStaticNat.reverseMatchToThen(dstMatch)); }
@VisibleForTesting static NatRuleThen reverseMatchToThen(NatRuleMatch match) { return match.accept(DST_MATCH_TO_THEN); }
ReverseStaticNat { @VisibleForTesting static NatRuleThen reverseMatchToThen(NatRuleMatch match) { return match.accept(DST_MATCH_TO_THEN); } }
ReverseStaticNat { @VisibleForTesting static NatRuleThen reverseMatchToThen(NatRuleMatch match) { return match.accept(DST_MATCH_TO_THEN); }  }
ReverseStaticNat { @VisibleForTesting static NatRuleThen reverseMatchToThen(NatRuleMatch match) { return match.accept(DST_MATCH_TO_THEN); }   }
ReverseStaticNat { @VisibleForTesting static NatRuleThen reverseMatchToThen(NatRuleMatch match) { return match.accept(DST_MATCH_TO_THEN); }    }