private static boolean requiresWrap ( Map map ) { for ( Object value : map . values ( ) ) { if ( value instanceof Collection || value instanceof Map || value instanceof Object [ ] ) { return true ; } } return false ; }
Checks whether a map requires any wrapping . This is used to avoid creating a copy of a map if all of its fields can be handled natively .