boolean (byte @NotNull [] classBytes, final @NotNull String methodName) { Ref<Boolean> contains = Ref.create(Boolean.FALSE); ClassVisitor visitor = new ClassVisitor(Opcodes.API_VERSION) { @Override public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) { return new MethodVisitor(Opcodes.API_VERSION) { @Override public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) { if (name.equals(methodName)) { contains.set(Boolean.TRUE); } } }; } }; ClassReader reader = new ClassReader(classBytes); reader.accept(visitor, 0); return contains.get(); }