code: public final <T> T decode(Object value) {
        if (value == null) {
           return null;
        }
        if (value instanceof Collection) {
           List<T> list = new ArrayList<>();
           Cast.<Collection<?>>as(value).forEach(o -> list.add(decode(o)));
           return Cast.as(list);
        }
        if (value instanceof Map) {
           Map<String, T> map = new HashMap<>();
           Cast.<Map<?, ?>>as(value).forEach((k, v) -> map.put(k.toString(), decode(v)));
           return Cast.as(map);
        }
        if (value instanceof Val) {
           return decodeImpl(Cast.<Val>as(value).get());
        }
        return decodeImpl(value);
     }
docs: Converts an object to desired type
  
  @param <T>   the target type parameter
  @param value the value to convert
  @return the result of conversion