if(!(statement instanceof MethodDeclaration) ){
continue;
}
// find all similar nodes
BlockContainsFinder replacementFinder = new BlockContainsFinder(((MethodDeclaration) statement).getFunction().getBody(), toSearchNodes);
replacementFinder.perform();
// add the matches.
fDuplicates.addAll(replacementFinder.getMatches());
}
// at least, the selected nodes have to get found...
//Assert.isLegal(fDuplicates.size() > 0);
// this does not work if the user doesnt select a statement (e.g. just a variable in a MethodInvocation)