Implement toJavaEquals() and toJavaToString().