class TypeToken {

  @NonNull
  public static <T> TypeToken<T> of(@NonNull Safe<T> token) {
    Type superclass = token.getClass().getGenericSuperclass();
    if (superclass instanceof Class) {
      throw new IllegalArgumentException("Missing type parameters");
    }
    // Safe because superclass is not instanceof Class
    @SuppressWarnings("ConstantConditions")
    Type type = ((ParameterizedType) superclass).getActualTypeArguments()[0];
    return of(type);
  }

  private  TypeToken();

}