@Test public void testResolveNatSituationWithoutWildcard() { final int expectedResult = 1; final int actualResult = this.util.resolveWildcards( new NATSituation(NATFeatureRealization.CONNECTION_DEPENDENT, NATFeatureRealization.CONNECTION_DEPENDENT, NATFeatureRealization.CONNECTION_DEPENDENT, NATFeatureRealization.CONNECTION_DEPENDENT)).size(); assertEquals(expectedResult, actualResult); }
public Set<NATSituation> resolveWildcards(final NATSituation withWildcard) { final Set<NATSituation> result = new HashSet<NATSituation>(); final NATBehavior clientNat = withWildcard.getClientNATBehavior(); final Set<NATBehavior> clientBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(clientNat)) { clientBehaviors.addAll(this.resolveWildcardInNatBehavior(clientNat)); } else { clientBehaviors.add(clientNat); } final NATBehavior serverNat = withWildcard.getServiceNATBehavior(); final Set<NATBehavior> serverBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(serverNat)) { serverBehaviors.addAll(this.resolveWildcardInNatBehavior(serverNat)); } else { serverBehaviors.add(serverNat); } for (NATBehavior clientBehavior : clientBehaviors) { for (NATBehavior serverBehavior : serverBehaviors) { result.add(new NATSituation(clientBehavior, serverBehavior)); } } return Collections.unmodifiableSet(result); }
NATTraversalTechniqueUtil { public Set<NATSituation> resolveWildcards(final NATSituation withWildcard) { final Set<NATSituation> result = new HashSet<NATSituation>(); final NATBehavior clientNat = withWildcard.getClientNATBehavior(); final Set<NATBehavior> clientBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(clientNat)) { clientBehaviors.addAll(this.resolveWildcardInNatBehavior(clientNat)); } else { clientBehaviors.add(clientNat); } final NATBehavior serverNat = withWildcard.getServiceNATBehavior(); final Set<NATBehavior> serverBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(serverNat)) { serverBehaviors.addAll(this.resolveWildcardInNatBehavior(serverNat)); } else { serverBehaviors.add(serverNat); } for (NATBehavior clientBehavior : clientBehaviors) { for (NATBehavior serverBehavior : serverBehaviors) { result.add(new NATSituation(clientBehavior, serverBehavior)); } } return Collections.unmodifiableSet(result); } }
NATTraversalTechniqueUtil { public Set<NATSituation> resolveWildcards(final NATSituation withWildcard) { final Set<NATSituation> result = new HashSet<NATSituation>(); final NATBehavior clientNat = withWildcard.getClientNATBehavior(); final Set<NATBehavior> clientBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(clientNat)) { clientBehaviors.addAll(this.resolveWildcardInNatBehavior(clientNat)); } else { clientBehaviors.add(clientNat); } final NATBehavior serverNat = withWildcard.getServiceNATBehavior(); final Set<NATBehavior> serverBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(serverNat)) { serverBehaviors.addAll(this.resolveWildcardInNatBehavior(serverNat)); } else { serverBehaviors.add(serverNat); } for (NATBehavior clientBehavior : clientBehaviors) { for (NATBehavior serverBehavior : serverBehaviors) { result.add(new NATSituation(clientBehavior, serverBehavior)); } } return Collections.unmodifiableSet(result); } private  NATTraversalTechniqueUtil(); }
NATTraversalTechniqueUtil { public Set<NATSituation> resolveWildcards(final NATSituation withWildcard) { final Set<NATSituation> result = new HashSet<NATSituation>(); final NATBehavior clientNat = withWildcard.getClientNATBehavior(); final Set<NATBehavior> clientBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(clientNat)) { clientBehaviors.addAll(this.resolveWildcardInNatBehavior(clientNat)); } else { clientBehaviors.add(clientNat); } final NATBehavior serverNat = withWildcard.getServiceNATBehavior(); final Set<NATBehavior> serverBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(serverNat)) { serverBehaviors.addAll(this.resolveWildcardInNatBehavior(serverNat)); } else { serverBehaviors.add(serverNat); } for (NATBehavior clientBehavior : clientBehaviors) { for (NATBehavior serverBehavior : serverBehaviors) { result.add(new NATSituation(clientBehavior, serverBehavior)); } } return Collections.unmodifiableSet(result); } private  NATTraversalTechniqueUtil(); Set<NATSituation> parseNATSituations(final String resourceName); Set<NATSituation> resolveWildcards(final NATSituation withWildcard); Set<NATSituation> getAllPossibleNATSituations(); static NATTraversalTechniqueUtil getInstance(); }
NATTraversalTechniqueUtil { public Set<NATSituation> resolveWildcards(final NATSituation withWildcard) { final Set<NATSituation> result = new HashSet<NATSituation>(); final NATBehavior clientNat = withWildcard.getClientNATBehavior(); final Set<NATBehavior> clientBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(clientNat)) { clientBehaviors.addAll(this.resolveWildcardInNatBehavior(clientNat)); } else { clientBehaviors.add(clientNat); } final NATBehavior serverNat = withWildcard.getServiceNATBehavior(); final Set<NATBehavior> serverBehaviors = new HashSet<NATBehavior>(); if (this.hasWildcard(serverNat)) { serverBehaviors.addAll(this.resolveWildcardInNatBehavior(serverNat)); } else { serverBehaviors.add(serverNat); } for (NATBehavior clientBehavior : clientBehaviors) { for (NATBehavior serverBehavior : serverBehaviors) { result.add(new NATSituation(clientBehavior, serverBehavior)); } } return Collections.unmodifiableSet(result); } private  NATTraversalTechniqueUtil(); Set<NATSituation> parseNATSituations(final String resourceName); Set<NATSituation> resolveWildcards(final NATSituation withWildcard); Set<NATSituation> getAllPossibleNATSituations(); static NATTraversalTechniqueUtil getInstance();  }