@SuppressWarnings("unchecked")
  protected Class<P> getProviderClass() {
    final Type type = getClass().getGenericSuperclass();
    return (Class<P>) ((ParameterizedType) type).getActualTypeArguments()[1];
  }
@ SuppressWarnings ( "unchecked" ) protected Class < P > getProviderClass ( ) { final Type type = getClass ( ) . getGenericSuperclass ( ) ; return ( Class < P > ) ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) [ 1 ] ; }
@return the class of the provider of type P. Uses {@link ParameterizedType} to compute the class. Override it to
support anonymous classes which do not play well with {@link ParameterizedType}'s.