docs: @SuppressWarnings("unchecked")
      public static <T> T valueOf(Instance obj) {
          if (obj == null) {
              return null;
          }
          JavaClass t = obj.getJavaClass();
          InstanceConverter c = CONVERTERS.get(obj.getJavaClass().getName());
          while(c == null && t.getSuperClass() != null) {
              t = t.getSuperClass();
              c = CONVERTERS.get(obj.getJavaClass().getName());
          }
          if (c == null) {
              // return instance as is
              return (T) obj;
          }
          else {
          return (T)c.convert(obj);
      }
      }