{"action":"created","issue":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/506","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/506/labels{/name}","comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/506/comments","events_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/506/events","html_url":"https://github.com/joel-costigliola/assertj-core/pull/506","id":111345379,"number":506,"title":"Added containing-semantics for asserting content in OptionalAsserter","user":{"login":"ovstetun","id":41553,"avatar_url":"https://avatars.githubusercontent.com/u/41553?v=3","gravatar_id":"","url":"https://api.github.com/users/ovstetun","html_url":"https://github.com/ovstetun","followers_url":"https://api.github.com/users/ovstetun/followers","following_url":"https://api.github.com/users/ovstetun/following{/other_user}","gists_url":"https://api.github.com/users/ovstetun/gists{/gist_id}","starred_url":"https://api.github.com/users/ovstetun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovstetun/subscriptions","organizations_url":"https://api.github.com/users/ovstetun/orgs","repos_url":"https://api.github.com/users/ovstetun/repos","events_url":"https://api.github.com/users/ovstetun/events{/privacy}","received_events_url":"https://api.github.com/users/ovstetun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-14T08:07:38Z","updated_at":"2015-10-20T09:59:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/pulls/506","html_url":"https://github.com/joel-costigliola/assertj-core/pull/506","diff_url":"https://github.com/joel-costigliola/assertj-core/pull/506.diff","patch_url":"https://github.com/joel-costigliola/assertj-core/pull/506.patch"},"body":"I wish to do a more functional style for deeper asserting on the content of an optional. The implementation allows the following style for asserting on Optionals:\r\n```java\r\nassertThat(Optional.of(someString)).containing(s -> {\r\n  assertThat(s).isEqualTo(\"something\");\r\n  assertThat(s).startsWith(\"some\");\r\n  assertThat(s).endsWith(\"thing\");\r\n});\r\n```\r\n\r\nAbove will fail for any ```Optional.empty```."},"comment":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/comments/149503249","html_url":"https://github.com/joel-costigliola/assertj-core/pull/506#issuecomment-149503249","issue_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/506","id":149503249,"user":{"login":"ovstetun","id":41553,"avatar_url":"https://avatars.githubusercontent.com/u/41553?v=3","gravatar_id":"","url":"https://api.github.com/users/ovstetun","html_url":"https://github.com/ovstetun","followers_url":"https://api.github.com/users/ovstetun/followers","following_url":"https://api.github.com/users/ovstetun/following{/other_user}","gists_url":"https://api.github.com/users/ovstetun/gists{/gist_id}","starred_url":"https://api.github.com/users/ovstetun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovstetun/subscriptions","organizations_url":"https://api.github.com/users/ovstetun/orgs","repos_url":"https://api.github.com/users/ovstetun/repos","events_url":"https://api.github.com/users/ovstetun/events{/privacy}","received_events_url":"https://api.github.com/users/ovstetun/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T09:59:40Z","updated_at":"2015-10-20T09:59:40Z","body":"I have also tried to think of a different name, and will happily refactor naming. A couple suggestions could be\r\n\r\n```public S satisfies(Consumer<T> requirement) {...}```\r\n\r\n* ```assertThat(o).satisfies(s -> {```\r\n* ```assertThat(o).satisfiesRequirement(s -> {```\r\n"}}