code: public final <T> T nextValue(@NonNull Class<T> clazz) throws IOException {
        if (JsonSerializable.class.isAssignableFrom(clazz)) {
           return readReadable(clazz);
        } else if (peek() == JsonTokenType.BEGIN_OBJECT) {
           Reflect reflected = Reflect.onClass(clazz);
           Optional<Method> staticRead = reflected.getMethods("read", 1).stream()
                                                  .filter(m -> JsonReader.class.isAssignableFrom(
                                                     m.getParameterTypes()[0]))
                                                  .filter(m -> Modifier.isStatic(m.getModifiers()))
                                                  .findFirst();
  
           if (staticRead.isPresent()) {
              try {
                 beginObject();
                 T result = Cast.as(staticRead.get().invoke(null, this));
                 endObject();
                 return result;
              } catch (IllegalAccessException | InvocationTargetException e) {
                 throw new IOException(e);
              }
           }
  
           try {
              T object = Reflect.onClass(clazz).create().get();
              beginObject();
              new BeanMap(object).putAll(nextMap());
              endObject();
              return object;
           } catch (ReflectionException e) {
              throw new IOException(e);
           }
        }
        return nextValue().as(clazz);
     }
docs: Reads the next value with given type
  
  @param <T>   the type parameter
  @param clazz the clazz
  @return The next value
  @throws IOException Something went wrong reading