public void add ( Object key , Object value ) { Object existing = mMap . get ( key ) ; if ( existing instanceof List ) { if ( value instanceof List ) { ( ( List ) existing ) . addAll ( ( List ) value ) ; } else { ( ( List ) existing ) . add ( value ) ; } } else if ( existing == null && ! mMap . containsKey ( key ) ) { if ( value instanceof List ) { mMap . put ( key , new ArrayList ( ( List ) value ) ) ; } else { mMap . put ( key , value ) ; } } else { List list = new ArrayList ( ) ; list . add ( existing ) ; if ( value instanceof List ) { list . addAll ( ( List ) value ) ; } else { list . add ( value ) ; } mMap . put ( key , list ) ; } }
Add more than one value associated with the given key .