Returning an optional that contains a boxed primitive type is prohibitively expensive compared to returning a primitive type because the optional has two levels of boxing instead of zero. Therefore, the library designers saw fit to provide analogues of Optional<T> for the primitive types int, long, and double.
Except it shouldn't be compared to returning just a primitive type, as that doesn't have an actual way to indicate "no value," (other than agreeing that some value, such as negative one, can mean no value, if that option is available). So, it should be compared to just a boxed primitive (one level).