public static < E > E checkInstanceOf ( Class < E > type , Object object , String errorMessage ) { isNotNull ( type , "type" ) ; if ( ! type . isInstance ( object ) ) { throw new IllegalArgumentException ( errorMessage ) ; } return ( E ) object ; }
Tests whether the supplied object is an instance of the supplied class type .