protected MethodNode getMethod(ClassNode cls, String method) { for (MethodNode mth : cls.getMethods()) { if (mth.getName().equals(method)) { return mth; } } fail("Method not found " + method + " in class " + cls); return null; }