{"action":"opened","issue":{"url":"https://api.github.com/repos/javaslang/javaslang/issues/1197","repository_url":"https://api.github.com/repos/javaslang/javaslang","labels_url":"https://api.github.com/repos/javaslang/javaslang/issues/1197/labels{/name}","comments_url":"https://api.github.com/repos/javaslang/javaslang/issues/1197/comments","events_url":"https://api.github.com/repos/javaslang/javaslang/issues/1197/events","html_url":"https://github.com/javaslang/javaslang/issues/1197","id":141506255,"number":1197,"title":"Option not empty after map to null","user":{"login":"manu-m","id":16662727,"avatar_url":"https://avatars.githubusercontent.com/u/16662727?v=3","gravatar_id":"","url":"https://api.github.com/users/manu-m","html_url":"https://github.com/manu-m","followers_url":"https://api.github.com/users/manu-m/followers","following_url":"https://api.github.com/users/manu-m/following{/other_user}","gists_url":"https://api.github.com/users/manu-m/gists{/gist_id}","starred_url":"https://api.github.com/users/manu-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manu-m/subscriptions","organizations_url":"https://api.github.com/users/manu-m/orgs","repos_url":"https://api.github.com/users/manu-m/repos","events_url":"https://api.github.com/users/manu-m/events{/privacy}","received_events_url":"https://api.github.com/users/manu-m/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-17T07:55:44Z","updated_at":"2016-03-17T07:55:44Z","closed_at":null,"body":"After calling map on a Some instance with a callback that returns null, the resulting Option object is still a Some instance.\r\n\r\n```\r\nOption.of(\"Hello World\").map(s -> null) // results in Some(null) not None()\r\n```\r\nFrom my point of view it seems to be wrong or is it implemented in Scala in the same way?\r\n\r\nMay be the implementation of map method should changed to something like following snippet?\r\n```\r\n@Override\r\ndefault <U> Option<U> map(Function<? super T, ? extends U> mapper) {\r\n    Objects.requireNonNull(mapper, \"mapper is null\");\r\n    return Option.of(mapper.apply(get()));\r\n}\r\n```"}}