code: @SuppressWarnings("unchecked")
      private static void checkTypeParameter(List<String> errorMessages, Class type) {
          // Only check classes and interfaces that extend Storable.
          if (type != null && Storable.class.isAssignableFrom(type)) {
              if (Storable.class == type) {
                  return;
              }
          } else {
              return;
          }
  
          // Check all superclasses and interfaces.
          checkTypeParameter(errorMessages, type.getSuperclass());
  
          for (Class c : type.getInterfaces()) {
              checkTypeParameter(errorMessages, c);
          }
  
          for (Type t : type.getGenericInterfaces()) {
              if (t instanceof ParameterizedType) {
                  ParameterizedType pt = (ParameterizedType)t;
                  if (pt.getRawType() == Storable.class) {
                      // Found exactly which parameter is passed directly to
                      // Storable. Make sure that it is in the proper bounds.
                      Type arg = pt.getActualTypeArguments()[0];
                      Class param;
                      if (arg instanceof ParameterizedType) {
                          Type raw = ((ParameterizedType)arg).getRawType();
                          if (raw instanceof Class) {
                              param = (Class)raw;
                          } else {
                              continue;
                          }
                      } else if (arg instanceof Class) {
                          param = (Class)arg;
                      } else if (arg instanceof TypeVariable) {
                          // TODO
                          continue;
                      } else {
                          continue;
                      }
                      if (Storable.class.isAssignableFrom(param)) {
                          if (!param.isAssignableFrom(type)) {
                              errorMessages.add
                                  ("Type parameter passed from " + type +
                                   " to Storable must be a " + type.getName() + ": " + param);
                              return;
                          }
                      } else {
                          errorMessages.add
                              ("Type parameter passed from " + type +
                               " to Storable must be a Storable: " + param);
                          return;
                      }
                  }
              }
          }
      }
docs: Make sure that the parameter type that is specified to Storable can be
  assigned to a Storable, and that the given type can be assigned to
  it. Put another way, the upper bound is Storable, and the lower bound
  is the given type. type <= parameterized type <= Storable