@Test public void testGetSetOfMethodsWithCallSite(){ BranchPairPool.getInstance().addPair(branch1,branch3,callSite2); Assert.assertEquals(2, BranchPairPool.getInstance().getSetOfMethodsWithCallSite().size()); Assert.assertTrue(BranchPairPool.getInstance().getSetOfMethodsWithCallSite().contains(methodName)); Assert.assertTrue(BranchPairPool.getInstance().getSetOfMethodsWithCallSite().contains(methodName+"_2")); }
public Set<String> getSetOfMethodsWithCallSite(){ Set<String> result = new HashSet<>(); for(BranchPair pair: pool){ if(!result.contains(pair.getCallSite().getMethodName())){ result.add(pair.getCallSite().getMethodName()); } } return result; }
BranchPairPool { public Set<String> getSetOfMethodsWithCallSite(){ Set<String> result = new HashSet<>(); for(BranchPair pair: pool){ if(!result.contains(pair.getCallSite().getMethodName())){ result.add(pair.getCallSite().getMethodName()); } } return result; } }
BranchPairPool { public Set<String> getSetOfMethodsWithCallSite(){ Set<String> result = new HashSet<>(); for(BranchPair pair: pool){ if(!result.contains(pair.getCallSite().getMethodName())){ result.add(pair.getCallSite().getMethodName()); } } return result; } private  BranchPairPool(); }
BranchPairPool { public Set<String> getSetOfMethodsWithCallSite(){ Set<String> result = new HashSet<>(); for(BranchPair pair: pool){ if(!result.contains(pair.getCallSite().getMethodName())){ result.add(pair.getCallSite().getMethodName()); } } return result; } private  BranchPairPool(); static BranchPairPool getInstance(); void addPair(Branch firstBranch, Branch secondBranch,  BytecodeInstruction callSite); void addPair(Branch firstBranch, Branch secondBranch,  BytecodeInstruction callSite, boolean expression); Set<String> getSetOfMethodsWithCallSite(); List<BranchPair> getBranchPairs(); }
BranchPairPool { public Set<String> getSetOfMethodsWithCallSite(){ Set<String> result = new HashSet<>(); for(BranchPair pair: pool){ if(!result.contains(pair.getCallSite().getMethodName())){ result.add(pair.getCallSite().getMethodName()); } } return result; } private  BranchPairPool(); static BranchPairPool getInstance(); void addPair(Branch firstBranch, Branch secondBranch,  BytecodeInstruction callSite); void addPair(Branch firstBranch, Branch secondBranch,  BytecodeInstruction callSite, boolean expression); Set<String> getSetOfMethodsWithCallSite(); List<BranchPair> getBranchPairs();  }