public void writeMethodHandle(MethodHandleReference methodHandleReference) throws IOException {
        writer.write(MethodHandleType.toString(methodHandleReference.getMethodHandleType()));
        writer.write('@');

        Reference memberReference = methodHandleReference.getMemberReference();
        if (memberReference instanceof MethodReference) {
            writeMethodDescriptor((MethodReference)memberReference);
        } else {
            writeFieldDescriptor((FieldReference)memberReference);
        }
    }
@Test
    public void testWriteMethodHandle_methodAccess() throws IOException {
        DexFormattedWriter writer = new DexFormattedWriter(output);

        writer.writeMethodHandle(getMethodHandleReferenceForMethod());

        Assert.assertEquals("invoke-instance@Ldefining/class;->methodName(Lparam1;Lparam2;)Lreturn/type;",
                output.toString());
    }