private JsonObject copyWithContext(JsonObject jsonObj,int context){
  JsonObject copy=new JsonObject();
  for (  Map.Entry<String,JsonElement> entry : jsonObj.entrySet()) {
    String field=entry.getKey();
    if (!field.equals(Utils.CHILDREN_PROP)) {
      copy.add(field,entry.getValue());
    }
  }
  copy.addProperty(CONTEXT_PROP,Integer.valueOf(context));
  return copy;
}

private JsonObject copyWithContext ( JsonObject jsonObj , int context ) { JsonObject copy = new JsonObject ( ) ; for ( Map . Entry < String , JsonElement > entry : jsonObj . entrySet ( ) ) { String field = entry . getKey ( ) ; if ( ! field . equals ( Utils . CHILDREN_PROP ) ) { copy . add ( field , entry . getValue ( ) ) ; } } copy . addProperty ( CONTEXT_PROP , Integer . valueOf ( context ) ) ; return copy ; }
copies all the properties of the given json object except the children property to a new json object . adds a context property with the given context index . returns the new json object .
