class InvokeMatcherBuilder {

    private List<String> classesNames = new ArrayList<String>();
    private List<String> methodNames = new ArrayList<String>();
    private List<String> argSignatures = new ArrayList<String>();


    public InvokeMatcherBuilder atClass(String... classesNames) {
        for(String clz : classesNames) {
            this.classesNames.add(clz.replace('/','.'));
        }
        return this;
    }

    public InvokeMatcherBuilder atMethod(String... methodNames) {
        for(String method : methodNames) {
            this.methodNames.add(method);
        }
        return this;
    }

    public InvokeMatcherBuilder withArgs(String... argSignatures) {
        for(String method : argSignatures) {
            this.argSignatures.add(method);
        }
        return this;
    }

    public boolean matches(OpcodeStackDetector opcodeStackDetector) {
        if(classesNames.size() != 0 && !classesNames.contains(opcodeStackDetector.getClassConstantOperand().replace('/','.'))) {
            return false;
        }
        if(methodNames.size() != 0 && !methodNames.contains(opcodeStackDetector.getNameConstantOperand())) {
            return false;
        }
        if(argSignatures.size() != 0 && !argSignatures.contains(opcodeStackDetector.getSigConstantOperand())) {
            return false;
        }
        return true;
    }


    public boolean matches(Instruction instruction, ConstantPoolGen cpg) {<FILL_FUNCTION_BODY>}
}

        if(instruction != null && instruction instanceof InvokeInstruction) {
            InvokeInstruction invokeInstruction = (InvokeInstruction) instruction;
            if (classesNames.size() != 0 && !classesNames.contains(invokeInstruction.getClassName(cpg))) {
                return false;
            }
            else if (methodNames.size() != 0 && !methodNames.contains(invokeInstruction.getMethodName(cpg))) {
                return false;
            }
            else if (argSignatures.size() != 0 && !argSignatures.contains(invokeInstruction.getSignature(cpg))) {
                return false;
            }
            return true;
        }
        return false;
    
<no_super_class>