// locate the writeFields method that will be overridden.
final List<Type> parameterTypes = new ArrayList<Type>();
parameterTypes.add(context.getObject());
parameterTypes.add(this.getObjectOutputStream());
final Method method = writer
.getMostDerivedMethod(SerializationConstants.CLIENT_OBJECT_WRITER_IMPL_WRITE0_METHOD, parameterTypes);
final NewMethod newMethod = method.copy(writer);
newMethod.setAbstract(false);
// rename parameters to the same names used in templates...
final List<MethodParameter> newMethodParameters = newMethod.getParameters();
final NewMethodParameter object = (NewMethodParameter) newMethodParameters.get(0);