question: @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private static Object asSimpleBinding ( Object objToClean ) { if ( objToClean instanceof ODocument ) { logger . trace ( "Converting embedded ODocument {} to map " , objToClean ) ; return DocumentUtil . toMap ( ( ODocument ) objToClean , false ) ; } else if ( objToClean instanceof List ) { logger . trace ( "Checking embedded list {} " , objToClean ) ; return toSimpleModel ( ( List ) objToClean ) ; } else if ( objToClean instanceof Set ) { logger . trace ( "Converting embedded Set {} " , objToClean ) ; return toSimpleModel ( ( Set ) objToClean ) ; } else if ( objToClean instanceof Map ) { logger . trace ( "Checking embedded map {} " , objToClean ) ; return toSimpleModel ( ( Map ) objToClean ) ; } else if ( objToClean instanceof com . orientechnologies . orient . core . id . ORID ) { logger . warn ( "Unexpected value of type ORecordId in document. Returning as String.{}" , objToClean ) ; return objToClean . toString ( ) ; } else { return objToClean ; } }
target:  Recursively ensure that the passed type is represented or converted to JSON object model simple binding types, i.e. ODocument to Map, Set to List  Modifies the passed in objToClean where possible (List, Map),  returns new types where it is not (ODocument, Set)