assertCompiles(memberSelectMatches(false, new InstanceMethod(
Matchers.<ExpressionTree>anything(), "count")));
}
private Scanner memberSelectMatches(final boolean shouldMatch, final InstanceMethod toMatch) {
return new Scanner() {
@Override
public Void visitMemberSelect(MemberSelectTree node, VisitorState visitorState) {
if (getCurrentPath().getParentPath().getLeaf().getKind() == Kind.METHOD_INVOCATION) {
assertTrue(node.toString(),
!shouldMatch ^ toMatch.matches(node, visitorState));