I am asking this question just for sure. According to my experience, the answer is no.
Take the following gremlin statements for example:
ResultSet results = client.alias("g").submit(g.V().filter(it -> it.get().value("name") == "marko"));
for (Result result: results) {
System.out.println(result.getString());
}
This code example will cause errors like:
...
...
Caused by:
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: An error occurred during serialization of this request [RequestMessage{, requestId=268d5630-0c4c-4293-bf39-2aea9136f036, op='bytecode', processor='traversal', args={gremlin=[[], [V(), filter(TinkerpopTest$$Lambda$31/1856158867@35a7023b)]], aliases={g=g}}}] - it could not be sent to the server - Reason: org.apache.tinkerpop.gremlin.driver.ser.SerializationException: java.lang.IllegalArgumentException: Class is not registered: TinkerpopTest$$Lambda$31/1856158867