FieldSpec createBinaryDefinition(String binary) {
        if (binary.length() < 65534) {
            return FieldSpec.builder(String.class, BINARY)
                    .addModifiers(Modifier.PUBLIC, Modifier.FINAL, Modifier.STATIC)
                    .initializer("$S", binary)
                    .build();
        }

        String[] argsArray = binary.split("(?<=\\G.{65534})");
        StringBuilder stringBuilderString = new StringBuilder().append("new StringBuilder()");
        for (String s : argsArray) {
            stringBuilderString.append(".append(\"");
            stringBuilderString.append(
                    s.replaceAll("\\$", "\\$\\$")); // escape $ which bytecode may contain
            stringBuilderString.append("\")");
        }
        stringBuilderString.append(".toString()");
        return FieldSpec.builder(String.class, BINARY)
                .addModifiers(Modifier.PUBLIC, Modifier.FINAL, Modifier.STATIC)
                .initializer(CodeBlock.of(stringBuilderString.toString()))
                .build();
    }
@Test
    public void testBinaryWithUnlinkedLibraryLengthOver65534() throws Exception {
        solidityFunctionWrapper.createBinaryDefinition(
                "0x"
                        + "a".repeat(40000)
                        + "__$927c5a12e2f339676f56d42ec1c0537964$__"
                        + "a".repeat(40000));
    }