Add unit tests for Optional/Present/Absent logic