@Override public void writeCallSite(CallSiteReference callSiteReference) throws IOException {
        writeSimpleName(callSiteReference.getName());
        writer.write('(');
        writeQuotedString(callSiteReference.getMethodName());
        writer.write(", ");
        writeMethodProtoDescriptor(callSiteReference.getMethodProto());

        for (EncodedValue encodedValue : callSiteReference.getExtraArguments()) {
            writer.write(", ");
            writeEncodedValue(encodedValue);
        }

        writer.write(")@");
        MethodHandleReference methodHandle = callSiteReference.getMethodHandle();
        if (methodHandle.getMethodHandleType() != MethodHandleType.INVOKE_STATIC) {
            throw new IllegalArgumentException("The linker method handle for a call site must be of type invoke-static");
        }
        writeMethodDescriptor((MethodReference) callSiteReference.getMethodHandle().getMemberReference());
    }
@Test
    public void testWriteCallsite_withSpaces() throws IOException {
        BaksmaliWriter writer = new BaksmaliWriter(output);

        writer.writeCallSite(new ImmutableCallSiteReference(
                "callsiteName with spaces",
                getInvokeStaticMethodHandleReferenceForMethodWithSpaces(),
                "callSiteMethodName with spaces",
                getMethodProtoReferenceWithSpaces(),
                ImmutableList.of(
                        new ImmutableFieldEncodedValue(getFieldReferenceWithSpaces()),
                        new ImmutableMethodEncodedValue(getMethodReferenceWithSpaces()))));

        Assert.assertEquals(
                "`callsiteName with spaces`(\"callSiteMethodName with spaces\", " +
                        "(L`param with spaces 1`;L`param with spaces 2`;)Lreturn/type/`with spaces`;, " +
                        "Ldefining/class/`with spaces`;->`fieldName with spaces`:Lfield/`type with spaces`;, " +
                        "Ldefining/class/`with spaces`;->`methodName with spaces`(" +
                        "L`param with spaces 1`;L`param with spaces 2`;)Lreturn/type/`with spaces`;)@" +
                        "Ldefining/class/`with spaces`;->`methodName with spaces`(" +
                        "L`param with spaces 1`;L`param with spaces 2`;)Lreturn/type/`with spaces`;",
                output.toString());
    }