### Question:
InvokeMethods { public static void getPcodeForInvoke(PcodeOpEmitter pCode, int offset, AbstractConstantPoolInfoJava[] constantPool, JavaInvocationType type) { String descriptor = DescriptorDecoder.getDescriptorForInvoke(offset, constantPool, type); List<JavaComputationalCategory> categories = DescriptorDecoder.getParameterCategories(descriptor); boolean includeThisPointer = type.equals(JavaInvocationType.INVOKE_VIRTUAL) || type.equals(JavaInvocationType.INVOKE_SPECIAL) || type.equals(JavaInvocationType.INVOKE_INTERFACE); int stackPurge = DescriptorDecoder.getStackPurge(descriptor); if (includeThisPointer) { stackPurge += 4; } emitPcodeToMoveParams(pCode, categories, includeThisPointer, stackPurge); emitPcodeToResolveMethodReference(pCode, offset, constantPool, type); pCode.emitIndirectCall(CALL_TARGET); JavaComputationalCategory retType = DescriptorDecoder.getReturnCategoryOfMethodDescriptor(descriptor); switch (retType) { case CAT_1: pCode.emitPushCat1Value(CAT_1_RETURN); break; case CAT_2: pCode.emitPushCat2Value(CAT_2_RETURN); break; default: break; } } private  InvokeMethods(); static void getPcodeForInvoke(PcodeOpEmitter pCode, int offset,
			AbstractConstantPoolInfoJava[] constantPool,
			JavaInvocationType type); static void getPcodeForInvokeDynamic(PcodeOpEmitter pCode, int offset,
			AbstractConstantPoolInfoJava[] constantPool);  }### Answer:
@Test public void testGetPcodeForInvoke() throws IOException { ArrayList<Byte> classFile = new ArrayList<>(); TestClassFileCreator.appendMagic(classFile); TestClassFileCreator.appendVersions(classFile); TestClassFileCreator.appendCount(classFile, (short) 5); TestClassFileCreator.appendInvokeDynamicInfo(classFile, (short) 0, (short) 2); TestClassFileCreator.appendNameAndType(classFile, (short) 3, (short) 4); TestClassFileCreator.appendUtf8(classFile, "dynamicMethodName"); TestClassFileCreator.appendUtf8(classFile, "(JJII)I"); byte[] classFileBytes = TestClassFileCreator.getByteArray(classFile); AbstractConstantPoolInfoJava[] constantPool = TestClassFileCreator.getConstantPoolFromBytes(classFileBytes); PcodeOpEmitter pCode = new PcodeOpEmitter(language, opAddress, uniqueBase); InvokeMethods.getPcodeForInvoke(pCode, 1, constantPool, JavaInvocationType.INVOKE_DYNAMIC); PcodeOpEmitter expected = new PcodeOpEmitter(language, opAddress, uniqueBase); String descriptor = DescriptorDecoder.getDescriptorForInvoke(1, constantPool, JavaInvocationType.INVOKE_DYNAMIC); List<JavaComputationalCategory> categories = DescriptorDecoder.getParameterCategories(descriptor); InvokeMethods.emitPcodeToMoveParams(expected, categories, false, 24); InvokeMethods.emitPcodeToResolveMethodReference(expected, 1, constantPool, JavaInvocationType.INVOKE_DYNAMIC); expected.emitIndirectCall(InvokeMethods.CALL_TARGET); expected.emitPushCat1Value(InvokeMethods.CAT_1_RETURN); assertEquals("incorrect pcode for invoke dynamic: (JJII)I", expected, pCode); }