{"action":"created","comment":{"url":"https://api.github.com/repos/javaslang/javaslang/pulls/comments/40508504","id":40508504,"diff_hunk":"@@ -92,13 +92,14 @@\n \n     public static <T extends Comparable<? super T>> TreeSet<T> ofAll(java.lang.Iterable<? extends T> values) {\n         Objects.requireNonNull(values, \"values is null\");\n-        return new TreeSet<>(RedBlackTree.ofAll(values));\n+        return values.iterator().hasNext() ? new TreeSet<>(RedBlackTree.ofAll(values)) : empty();","path":"src/main/java/javaslang/collection/TreeSet.java","position":5,"original_position":5,"commit_id":"6e40306e710b342d156b526df7d8f516a19ba6cd","original_commit_id":"6e40306e710b342d156b526df7d8f516a19ba6cd","user":{"login":"danieldietrich","id":743833,"avatar_url":"https://avatars.githubusercontent.com/u/743833?v=3","gravatar_id":"","url":"https://api.github.com/users/danieldietrich","html_url":"https://github.com/danieldietrich","followers_url":"https://api.github.com/users/danieldietrich/followers","following_url":"https://api.github.com/users/danieldietrich/following{/other_user}","gists_url":"https://api.github.com/users/danieldietrich/gists{/gist_id}","starred_url":"https://api.github.com/users/danieldietrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieldietrich/subscriptions","organizations_url":"https://api.github.com/users/danieldietrich/orgs","repos_url":"https://api.github.com/users/danieldietrich/repos","events_url":"https://api.github.com/users/danieldietrich/events{/privacy}","received_events_url":"https://api.github.com/users/danieldietrich/received_events","type":"User","site_admin":false},"body":"You are right. hasNext() has also to be called by next() as of the API contract in Java docs. That means that it can be called twice or more without changing the public visible state. Thx for clarification.","created_at":"2015-09-27T19:35:21Z","updated_at":"2015-09-27T19:35:21Z","html_url":"https://github.com/javaslang/javaslang/pull/649#discussion_r40508504","pull_request_url":"https://api.github.com/repos/javaslang/javaslang/pulls/649","_links":{"self":{"href":"https://api.github.com/repos/javaslang/javaslang/pulls/comments/40508504"},"html":{"href":"https://github.com/javaslang/javaslang/pull/649#discussion_r40508504"},"pull_request":{"href":"https://api.github.com/repos/javaslang/javaslang/pulls/649"}}},"pull_request":{"url":"https://api.github.com/repos/javaslang/javaslang/pulls/649","id":46104486,"html_url":"https://github.com/javaslang/javaslang/pull/649","diff_url":"https://github.com/javaslang/javaslang/pull/649.diff","patch_url":"https://github.com/javaslang/javaslang/pull/649.patch","issue_url":"https://api.github.com/repos/javaslang/javaslang/issues/649","number":649,"state":"open","locked":false,"title":"Seq.range*() tests added; duplicate code removed","user":{"login":"ruslansennov","id":1582377,"avatar_url":"https://avatars.githubusercontent.com/u/1582377?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslansennov","html_url":"https://github.com/ruslansennov","followers_url":"https://api.github.com/users/ruslansennov/followers","following_url":"https://api.github.com/users/ruslansennov/following{/other_user}","gists_url":"https://api.github.com/users/ruslansennov/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslansennov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslansennov/subscriptions","organizations_url":"https://api.github.com/users/ruslansennov/orgs","repos_url":"https://api.github.com/users/ruslansennov/repos","events_url":"https://api.github.com/users/ruslansennov/events{/privacy}","received_events_url":"https://api.github.com/users/ruslansennov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-27T17:05:32Z","updated_at":"2015-09-27T19:35:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2256234818c938e8a08125cdeb5b3dac985519ae","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/javaslang/javaslang/pulls/649/commits","review_comments_url":"https://api.github.com/repos/javaslang/javaslang/pulls/649/comments","review_comment_url":"https://api.github.com/repos/javaslang/javaslang/pulls/comments{/number}","comments_url":"https://api.github.com/repos/javaslang/javaslang/issues/649/comments","statuses_url":"https://api.github.com/repos/javaslang/javaslang/statuses/6e40306e710b342d156b526df7d8f516a19ba6cd","head":{"label":"ruslansennov:setRange","ref":"setRange","sha":"6e40306e710b342d156b526df7d8f516a19ba6cd","user":{"login":"ruslansennov","id":1582377,"avatar_url":"https://avatars.githubusercontent.com/u/1582377?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslansennov","html_url":"https://github.com/ruslansennov","followers_url":"https://api.github.com/users/ruslansennov/followers","following_url":"https://api.github.com/users/ruslansennov/following{/other_user}","gists_url":"https://api.github.com/users/ruslansennov/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslansennov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslansennov/subscriptions","organizations_url":"https://api.github.com/users/ruslansennov/orgs","repos_url":"https://api.github.com/users/ruslansennov/repos","events_url":"https://api.github.com/users/ruslansennov/events{/privacy}","received_events_url":"https://api.github.com/users/ruslansennov/received_events","type":"User","site_admin":false},"repo":{"id":39698283,"name":"javaslang","full_name":"ruslansennov/javaslang","owner":{"login":"ruslansennov","id":1582377,"avatar_url":"https://avatars.githubusercontent.com/u/1582377?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslansennov","html_url":"https://github.com/ruslansennov","followers_url":"https://api.github.com/users/ruslansennov/followers","following_url":"https://api.github.com/users/ruslansennov/following{/other_user}","gists_url":"https://api.github.com/users/ruslansennov/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslansennov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslansennov/subscriptions","organizations_url":"https://api.github.com/users/ruslansennov/orgs","repos_url":"https://api.github.com/users/ruslansennov/repos","events_url":"https://api.github.com/users/ruslansennov/events{/privacy}","received_events_url":"https://api.github.com/users/ruslansennov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ruslansennov/javaslang","description":"A functional component library built for Java 8+ that provides persistent data types and functional control structures.","fork":true,"url":"https://api.github.com/repos/ruslansennov/javaslang","forks_url":"https://api.github.com/repos/ruslansennov/javaslang/forks","keys_url":"https://api.github.com/repos/ruslansennov/javaslang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruslansennov/javaslang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruslansennov/javaslang/teams","hooks_url":"https://api.github.com/repos/ruslansennov/javaslang/hooks","issue_events_url":"https://api.github.com/repos/ruslansennov/javaslang/issues/events{/number}","events_url":"https://api.github.com/repos/ruslansennov/javaslang/events","assignees_url":"https://api.github.com/repos/ruslansennov/javaslang/assignees{/user}","branches_url":"https://api.github.com/repos/ruslansennov/javaslang/branches{/branch}","tags_url":"https://api.github.com/repos/ruslansennov/javaslang/tags","blobs_url":"https://api.github.com/repos/ruslansennov/javaslang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruslansennov/javaslang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruslansennov/javaslang/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruslansennov/javaslang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruslansennov/javaslang/statuses/{sha}","languages_url":"https://api.github.com/repos/ruslansennov/javaslang/languages","stargazers_url":"https://api.github.com/repos/ruslansennov/javaslang/stargazers","contributors_url":"https://api.github.com/repos/ruslansennov/javaslang/contributors","subscribers_url":"https://api.github.com/repos/ruslansennov/javaslang/subscribers","subscription_url":"https://api.github.com/repos/ruslansennov/javaslang/subscription","commits_url":"https://api.github.com/repos/ruslansennov/javaslang/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruslansennov/javaslang/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruslansennov/javaslang/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruslansennov/javaslang/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruslansennov/javaslang/contents/{+path}","compare_url":"https://api.github.com/repos/ruslansennov/javaslang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruslansennov/javaslang/merges","archive_url":"https://api.github.com/repos/ruslansennov/javaslang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruslansennov/javaslang/downloads","issues_url":"https://api.github.com/repos/ruslansennov/javaslang/issues{/number}","pulls_url":"https://api.github.com/repos/ruslansennov/javaslang/pulls{/number}","milestones_url":"https://api.github.com/repos/ruslansennov/javaslang/milestones{/number}","notifications_url":"https://api.github.com/repos/ruslansennov/javaslang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruslansennov/javaslang/labels{/name}","releases_url":"https://api.github.com/repos/ruslansennov/javaslang/releases{/id}","created_at":"2015-07-25T18:48:11Z","updated_at":"2015-07-25T18:48:12Z","pushed_at":"2015-09-27T17:04:23Z","git_url":"git://github.com/ruslansennov/javaslang.git","ssh_url":"git@github.com:ruslansennov/javaslang.git","clone_url":"https://github.com/ruslansennov/javaslang.git","svn_url":"https://github.com/ruslansennov/javaslang","homepage":"http://javaslang.com","size":5769,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"javaslang:master","ref":"master","sha":"7899acc28b11b7061366c793199f2e0c596a4f60","user":{"login":"javaslang","id":5786132,"avatar_url":"https://avatars.githubusercontent.com/u/5786132?v=3","gravatar_id":"","url":"https://api.github.com/users/javaslang","html_url":"https://github.com/javaslang","followers_url":"https://api.github.com/users/javaslang/followers","following_url":"https://api.github.com/users/javaslang/following{/other_user}","gists_url":"https://api.github.com/users/javaslang/gists{/gist_id}","starred_url":"https://api.github.com/users/javaslang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javaslang/subscriptions","organizations_url":"https://api.github.com/users/javaslang/orgs","repos_url":"https://api.github.com/users/javaslang/repos","events_url":"https://api.github.com/users/javaslang/events{/privacy}","received_events_url":"https://api.github.com/users/javaslang/received_events","type":"Organization","site_admin":false},"repo":{"id":16378879,"name":"javaslang","full_name":"javaslang/javaslang","owner":{"login":"javaslang","id":5786132,"avatar_url":"https://avatars.githubusercontent.com/u/5786132?v=3","gravatar_id":"","url":"https://api.github.com/users/javaslang","html_url":"https://github.com/javaslang","followers_url":"https://api.github.com/users/javaslang/followers","following_url":"https://api.github.com/users/javaslang/following{/other_user}","gists_url":"https://api.github.com/users/javaslang/gists{/gist_id}","starred_url":"https://api.github.com/users/javaslang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javaslang/subscriptions","organizations_url":"https://api.github.com/users/javaslang/orgs","repos_url":"https://api.github.com/users/javaslang/repos","events_url":"https://api.github.com/users/javaslang/events{/privacy}","received_events_url":"https://api.github.com/users/javaslang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/javaslang/javaslang","description":"A functional component library built for Java 8+ that provides persistent data types and functional control structures.","fork":false,"url":"https://api.github.com/repos/javaslang/javaslang","forks_url":"https://api.github.com/repos/javaslang/javaslang/forks","keys_url":"https://api.github.com/repos/javaslang/javaslang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/javaslang/javaslang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/javaslang/javaslang/teams","hooks_url":"https://api.github.com/repos/javaslang/javaslang/hooks","issue_events_url":"https://api.github.com/repos/javaslang/javaslang/issues/events{/number}","events_url":"https://api.github.com/repos/javaslang/javaslang/events","assignees_url":"https://api.github.com/repos/javaslang/javaslang/assignees{/user}","branches_url":"https://api.github.com/repos/javaslang/javaslang/branches{/branch}","tags_url":"https://api.github.com/repos/javaslang/javaslang/tags","blobs_url":"https://api.github.com/repos/javaslang/javaslang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/javaslang/javaslang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/javaslang/javaslang/git/refs{/sha}","trees_url":"https://api.github.com/repos/javaslang/javaslang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/javaslang/javaslang/statuses/{sha}","languages_url":"https://api.github.com/repos/javaslang/javaslang/languages","stargazers_url":"https://api.github.com/repos/javaslang/javaslang/stargazers","contributors_url":"https://api.github.com/repos/javaslang/javaslang/contributors","subscribers_url":"https://api.github.com/repos/javaslang/javaslang/subscribers","subscription_url":"https://api.github.com/repos/javaslang/javaslang/subscription","commits_url":"https://api.github.com/repos/javaslang/javaslang/commits{/sha}","git_commits_url":"https://api.github.com/repos/javaslang/javaslang/git/commits{/sha}","comments_url":"https://api.github.com/repos/javaslang/javaslang/comments{/number}","issue_comment_url":"https://api.github.com/repos/javaslang/javaslang/issues/comments{/number}","contents_url":"https://api.github.com/repos/javaslang/javaslang/contents/{+path}","compare_url":"https://api.github.com/repos/javaslang/javaslang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/javaslang/javaslang/merges","archive_url":"https://api.github.com/repos/javaslang/javaslang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/javaslang/javaslang/downloads","issues_url":"https://api.github.com/repos/javaslang/javaslang/issues{/number}","pulls_url":"https://api.github.com/repos/javaslang/javaslang/pulls{/number}","milestones_url":"https://api.github.com/repos/javaslang/javaslang/milestones{/number}","notifications_url":"https://api.github.com/repos/javaslang/javaslang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/javaslang/javaslang/labels{/name}","releases_url":"https://api.github.com/repos/javaslang/javaslang/releases{/id}","created_at":"2014-01-30T14:07:25Z","updated_at":"2015-09-26T06:56:16Z","pushed_at":"2015-09-27T17:05:33Z","git_url":"git://github.com/javaslang/javaslang.git","ssh_url":"git@github.com:javaslang/javaslang.git","clone_url":"https://github.com/javaslang/javaslang.git","svn_url":"https://github.com/javaslang/javaslang","homepage":"http://javaslang.com","size":9707,"stargazers_count":309,"watchers_count":309,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":60,"forks":36,"open_issues":60,"watchers":309,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/javaslang/javaslang/pulls/649"},"html":{"href":"https://github.com/javaslang/javaslang/pull/649"},"issue":{"href":"https://api.github.com/repos/javaslang/javaslang/issues/649"},"comments":{"href":"https://api.github.com/repos/javaslang/javaslang/issues/649/comments"},"review_comments":{"href":"https://api.github.com/repos/javaslang/javaslang/pulls/649/comments"},"review_comment":{"href":"https://api.github.com/repos/javaslang/javaslang/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/javaslang/javaslang/pulls/649/commits"},"statuses":{"href":"https://api.github.com/repos/javaslang/javaslang/statuses/6e40306e710b342d156b526df7d8f516a19ba6cd"}}}}