private void emitClear(String fieldName,StringBuilder builder){
  builder.append("    public void ");
  builder.append(getClearName(fieldName));
  builder.append("() {\n      ");
  builder.append(getEnsureName(fieldName));
  builder.append("();\n      ");
  builder.append(fieldName);
  builder.append(".clear();\n");
  builder.append("    }\n\n");
}

private void emitClear ( String fieldName , StringBuilder builder ) { builder . append ( "    public void " ) ; builder . append ( getClearName ( fieldName ) ) ; builder . append ( "() {\n      " ) ; builder . append ( getEnsureName ( fieldName ) ) ; builder . append ( "();\n      " ) ; builder . append ( fieldName ) ; builder . append ( ".clear();\n" ) ; builder . append ( "    }\n\n" ) ; }
emits a method to clear a list or map . clearing the collections ensures that the collection is created .
