@Override
public boolean matches(T tree, VisitorState state) {
Types types = state.getTypes();
Type typeToCompare = typeToCompareSupplier.get(state);
return (typeToCompare != null &&
types.isCastable(((JCTree) tree).type, types.erasure(typeToCompare)));
}
}