public static < T > Class < T > unwrap ( Class < T > type ) { if ( type == null ) { throw new IllegalArgumentException ( ) ; } Class < T > unwrapped = ( Class < T > ) WRAP_TO_PRIMITIVE . get ( type ) ; return ( unwrapped == null ) ? type : unwrapped ; }
Guava unwrap alternative .