private void emitGetter(Method method,String methodName,String fieldName,String returnType,StringBuilder builder){
  builder.append("    @Override\n    public ");
  builder.append(returnType);
  builder.append(" ");
  builder.append(methodName);
  builder.append("() {\n");
  Class<?> returnTypeClass=method.getReturnType();
  if (isList(returnTypeClass) || isMap(returnTypeClass)) {
    builder.append("      ");
    builder.append(getEnsureName(fieldName));
    builder.append("();\n");
  }
  builder.append("      return ");
  builder.append(fieldName);
  builder.append(";\n    }\n\n");
}

private void emitGetter ( Method method , String methodName , String fieldName , String returnType , StringBuilder builder ) { builder . append ( "    @Override\n    public " ) ; builder . append ( returnType ) ; builder . append ( " " ) ; builder . append ( methodName ) ; builder . append ( "() {\n" ) ; Class < ? > returnTypeClass = method . getReturnType ( ) ; if ( isList ( returnTypeClass ) || isMap ( returnTypeClass ) ) { builder . append ( "      " ) ; builder . append ( getEnsureName ( fieldName ) ) ; builder . append ( "();\n" ) ; } builder . append ( "      return " ) ; builder . append ( fieldName ) ; builder . append ( ";\n    }\n\n" ) ; }
emits a method to get a field . getting a collection ensures that the collection is created .
