Implement a custom generic Optional type and write associated unit tests. Define GenericOptional with of, empty, is_present, get, or_else, and map operations. Expose optional_results(cases), where each case is a JSON object describing one operation, and return its result in order. of must reject null; get on an empty value must raise ValueError.
of are non-null JSON valuesget is called only for present optionals in valid inputsdef optional_results(cases):