ClosureExpression readClosure = new ClosureExpression(new Parameter[]{}, readClosureCode);
readClosure.setVariableScope(new VariableScope());
Expression klass = new MethodCallExpression(VariableExpression.THIS_EXPRESSION, "getClass", MethodCallExpression.NO_ARGUMENTS);
Expression classLoader = new MethodCallExpression(klass, "getClassLoader", MethodCallExpression.NO_ARGUMENTS);
Expression result = new MethodCallExpression(bais, "withObjectInputStream", new ArgumentListExpression(classLoader, readClosure));
body.addStatement(new ReturnStatement(result));
ClassNode[] exceptions = {ClassHelper.make(CloneNotSupportedException.class)};
cNode.addMethod("clone", ACC_PUBLIC, ClassHelper.OBJECT_TYPE, new Parameter[0], exceptions, body);
}