private void emitEnsureCollection(Method method,String fieldName,StringBuilder builder){
  builder.append("    protected void ");
  builder.append(getEnsureName(fieldName));
  builder.append("() {\n");
  builder.append("      if (");
  builder.append(fieldName);
  builder.append(" == null) {\n        ");
  builder.append(fieldName);
  builder.append(" = new ");
  builder.append(getImplName(method.getGenericReturnType(),true));
  builder.append("();\n");
  builder.append("      }\n");
  builder.append("    }\n");
}

private void emitEnsureCollection ( Method method , String fieldName , StringBuilder builder ) { builder . append ( "    protected void " ) ; builder . append ( getEnsureName ( fieldName ) ) ; builder . append ( "() {\n" ) ; builder . append ( "      if (" ) ; builder . append ( fieldName ) ; builder . append ( " == null) {\n        " ) ; builder . append ( fieldName ) ; builder . append ( " = new " ) ; builder . append ( getImplName ( method . getGenericReturnType ( ) , true ) ) ; builder . append ( "();\n" ) ; builder . append ( "      }\n" ) ; builder . append ( "    }\n" ) ; }
emit a method that ensures a collection is initialized .
