Collection < V > wrapValues ( K key , Collection < V > values ) { final Object backEnd = DataViewDelegate . undelegate ( values ) ; if ( backEnd instanceof List < ? > ) { return new SingleKeyValueListView ( key , ( List < V > ) values ) ; } if ( backEnd instanceof Set < ? > ) { return new SingleKeyValueSetView ( key , ( Set < V > ) values ) ; } throw new IllegalStateException ( "Unsupported type of the backend multimap: " + values . getClass ( ) ) ; //$NON-NLS-1$ }
Wrap the given values into a dedicated view .