docs: private static Class<?> getRestrictionClass(OptionID oid, final Parameter<?> firstopt, Map<OptionID, List<Pair<Parameter<?>, Class<?>>>> byopt) {
      Class<?> superclass = getRestrictionClass(firstopt);
      // Also look for more general restrictions:
      for(Pair<Parameter<?>, Class<?>> clinst : byopt.get(oid)) {
        if(clinst.getFirst() instanceof ClassParameter) {
          ClassParameter<?> cls = (ClassParameter<?>) clinst.getFirst();
          if(!cls.getRestrictionClass().equals(superclass) && cls.getRestrictionClass().isAssignableFrom(superclass)) {
            superclass = cls.getRestrictionClass();
          }
        }
        if(clinst.getFirst() instanceof ClassListParameter) {
          ClassListParameter<?> cls = (ClassListParameter<?>) clinst.getFirst();
          if(!cls.getRestrictionClass().equals(superclass) && cls.getRestrictionClass().isAssignableFrom(superclass)) {
            superclass = cls.getRestrictionClass();
          }
        }
      }
      return superclass;
    }