@Test public void testGetTravTechsForUnknownSituation() { final NATSituation natSituation = new NATSituation(NATFeatureRealization.DONT_CARE, NATFeatureRealization.DONT_CARE, NATFeatureRealization.DONT_CARE, NATFeatureRealization.DONT_CARE); final List<NATTraversalTechnique> expectedResult = new ArrayList<NATTraversalTechnique>(); expectedResult.add(new NATTraversalTechniqueMock("DirectConnection", 3, true)); expectedResult.add(new NATTraversalTechniqueMock("Reversal", 3, true)); expectedResult.add(new NATTraversalTechniqueMock("HolePunching", Integer.MAX_VALUE, true)); expectedResult.add(new NATTraversalTechniqueMock("Relaying", 7, false)); final List<NATTraversalTechnique> actualResult = this.tree.getAppropriateNATTraversalTechniques(natSituation); assertTrue(this.containsSameElements(expectedResult, actualResult)); }
@Override public List<NATTraversalTechnique> getAppropriateNATTraversalTechniques(final NATSituation natSituation) { List<NATTraversalTechnique> result = this.getTraversalTechniquesForNatSituation(natSituation); if (result == null) { result = new ArrayList<NATTraversalTechnique>(); } return result; }
MapDT implements DecisionTree { @Override public List<NATTraversalTechnique> getAppropriateNATTraversalTechniques(final NATSituation natSituation) { List<NATTraversalTechnique> result = this.getTraversalTechniquesForNatSituation(natSituation); if (result == null) { result = new ArrayList<NATTraversalTechnique>(); } return result; } }
MapDT implements DecisionTree { @Override public List<NATTraversalTechnique> getAppropriateNATTraversalTechniques(final NATSituation natSituation) { List<NATTraversalTechnique> result = this.getTraversalTechniquesForNatSituation(natSituation); if (result == null) { result = new ArrayList<NATTraversalTechnique>(); } return result; } MapDT(); }
MapDT implements DecisionTree { @Override public List<NATTraversalTechnique> getAppropriateNATTraversalTechniques(final NATSituation natSituation) { List<NATTraversalTechnique> result = this.getTraversalTechniquesForNatSituation(natSituation); if (result == null) { result = new ArrayList<NATTraversalTechnique>(); } return result; } MapDT(); @Override void buildDecisionTree(final Set<NATTraversalRule> rules); @Override List<NATTraversalTechnique> getAppropriateNATTraversalTechniques(final NATSituation natSituation); }
MapDT implements DecisionTree { @Override public List<NATTraversalTechnique> getAppropriateNATTraversalTechniques(final NATSituation natSituation) { List<NATTraversalTechnique> result = this.getTraversalTechniquesForNatSituation(natSituation); if (result == null) { result = new ArrayList<NATTraversalTechnique>(); } return result; } MapDT(); @Override void buildDecisionTree(final Set<NATTraversalRule> rules); @Override List<NATTraversalTechnique> getAppropriateNATTraversalTechniques(final NATSituation natSituation);  }