Add unit tests for Optional with typing