{"action":"created","comment":{"url":"https://api.github.com/repos/OpenGamma/Strata/pulls/comments/230385369","pull_request_review_id":171115735,"id":230385369,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDM4NTM2OQ==","diff_hunk":"@@ -301,6 +302,47 @@ public R next() {\n         ImmutableList.Builder<T>::build);\n   }\n \n+  /**\n+   * Collector used at the end of a stream to build an immutable list of\n+   * immutable lists of size equal to or less than partitionSize.\n+   * For example, the following list [a, b, c, d, e] with a partition\n+   * size of 2 will give [[a, b], [c, d], [e]].\n+   * <p>\n+   * A collector is used to gather data at the end of a stream operation.\n+   * This method returns a collector allowing streams to be gathered into\n+   * an {@link ImmutableList} of {@link ImmutableList}.\n+   *\n+   * @param partitionSize  the size of the partitions of the original list\n+   * @param <T>  the type of element in the list\n+   * @return the immutable list of lists collector\n+   */\n+  public static <T> Collector<T, ?, ImmutableList<ImmutableList<T>>> toImmutableListPartitions(int partitionSize) {\n+    return Collectors.collectingAndThen(\n+        Collectors.collectingAndThen(\n+            Guavate.toImmutableList(),\n+            objects -> Lists.partition(objects, partitionSize)),\n+        Guavate::toImmutables);\n+  }\n+\n+  /**\n+   * Helper method to transform a list of lists into their immutable counterparts.\n+   *\n+   * @param lists  the list of lists\n+   * @param <T>  the type of element in the list\n+   * @return the immutable lists\n+   */\n+  private static <T> ImmutableList<ImmutableList<T>> toImmutables(List<List<T>> lists) {\n+    ImmutableList.Builder<ImmutableList<T>> builder = ImmutableList.builder();\n+    for (List<T> innerList : lists) {\n+      if (innerList instanceof ImmutableList) {","path":"modules/collect/src/main/java/com/opengamma/strata/collect/Guavate.java","position":null,"original_position":44,"commit_id":"a5c66cff120f8962297530b02f741845cbae9d9f","original_commit_id":"44da5d8c7e1d41d0d14523b23cd0badd772cbb64","user":{"login":"Mistuus","id":12484911,"node_id":"MDQ6VXNlcjEyNDg0OTEx","avatar_url":"https://avatars0.githubusercontent.com/u/12484911?v=4","gravatar_id":"","url":"https://api.github.com/users/Mistuus","html_url":"https://github.com/Mistuus","followers_url":"https://api.github.com/users/Mistuus/followers","following_url":"https://api.github.com/users/Mistuus/following{/other_user}","gists_url":"https://api.github.com/users/Mistuus/gists{/gist_id}","starred_url":"https://api.github.com/users/Mistuus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mistuus/subscriptions","organizations_url":"https://api.github.com/users/Mistuus/orgs","repos_url":"https://api.github.com/users/Mistuus/repos","events_url":"https://api.github.com/users/Mistuus/events{/privacy}","received_events_url":"https://api.github.com/users/Mistuus/received_events","type":"User","site_admin":false},"body":"Tried iniling this method too but I think it looks better when this logic sits in its own method.","created_at":"2018-11-02T14:08:46Z","updated_at":"2018-11-02T14:08:46Z","html_url":"https://github.com/OpenGamma/Strata/pull/1839#discussion_r230385369","pull_request_url":"https://api.github.com/repos/OpenGamma/Strata/pulls/1839","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/comments/230385369"},"html":{"href":"https://github.com/OpenGamma/Strata/pull/1839#discussion_r230385369"},"pull_request":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/1839"}},"in_reply_to_id":230366699},"pull_request":{"url":"https://api.github.com/repos/OpenGamma/Strata/pulls/1839","id":227903300,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3OTAzMzAw","html_url":"https://github.com/OpenGamma/Strata/pull/1839","diff_url":"https://github.com/OpenGamma/Strata/pull/1839.diff","patch_url":"https://github.com/OpenGamma/Strata/pull/1839.patch","issue_url":"https://api.github.com/repos/OpenGamma/Strata/issues/1839","number":1839,"state":"open","locked":false,"title":"Collector to build immutable list partitions ","user":{"login":"Mistuus","id":12484911,"node_id":"MDQ6VXNlcjEyNDg0OTEx","avatar_url":"https://avatars0.githubusercontent.com/u/12484911?v=4","gravatar_id":"","url":"https://api.github.com/users/Mistuus","html_url":"https://github.com/Mistuus","followers_url":"https://api.github.com/users/Mistuus/followers","following_url":"https://api.github.com/users/Mistuus/following{/other_user}","gists_url":"https://api.github.com/users/Mistuus/gists{/gist_id}","starred_url":"https://api.github.com/users/Mistuus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mistuus/subscriptions","organizations_url":"https://api.github.com/users/Mistuus/orgs","repos_url":"https://api.github.com/users/Mistuus/repos","events_url":"https://api.github.com/users/Mistuus/events{/privacy}","received_events_url":"https://api.github.com/users/Mistuus/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-02T11:08:54Z","updated_at":"2018-11-02T14:08:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b15267a61ab09f041f8bf834b438907044cefef","assignee":{"login":"jodastephen","id":213212,"node_id":"MDQ6VXNlcjIxMzIxMg==","avatar_url":"https://avatars2.githubusercontent.com/u/213212?v=4","gravatar_id":"","url":"https://api.github.com/users/jodastephen","html_url":"https://github.com/jodastephen","followers_url":"https://api.github.com/users/jodastephen/followers","following_url":"https://api.github.com/users/jodastephen/following{/other_user}","gists_url":"https://api.github.com/users/jodastephen/gists{/gist_id}","starred_url":"https://api.github.com/users/jodastephen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodastephen/subscriptions","organizations_url":"https://api.github.com/users/jodastephen/orgs","repos_url":"https://api.github.com/users/jodastephen/repos","events_url":"https://api.github.com/users/jodastephen/events{/privacy}","received_events_url":"https://api.github.com/users/jodastephen/received_events","type":"User","site_admin":false},"assignees":[{"login":"jodastephen","id":213212,"node_id":"MDQ6VXNlcjIxMzIxMg==","avatar_url":"https://avatars2.githubusercontent.com/u/213212?v=4","gravatar_id":"","url":"https://api.github.com/users/jodastephen","html_url":"https://github.com/jodastephen","followers_url":"https://api.github.com/users/jodastephen/followers","following_url":"https://api.github.com/users/jodastephen/following{/other_user}","gists_url":"https://api.github.com/users/jodastephen/gists{/gist_id}","starred_url":"https://api.github.com/users/jodastephen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodastephen/subscriptions","organizations_url":"https://api.github.com/users/jodastephen/orgs","repos_url":"https://api.github.com/users/jodastephen/repos","events_url":"https://api.github.com/users/jodastephen/events{/privacy}","received_events_url":"https://api.github.com/users/jodastephen/received_events","type":"User","site_admin":false},{"login":"Mistuus","id":12484911,"node_id":"MDQ6VXNlcjEyNDg0OTEx","avatar_url":"https://avatars0.githubusercontent.com/u/12484911?v=4","gravatar_id":"","url":"https://api.github.com/users/Mistuus","html_url":"https://github.com/Mistuus","followers_url":"https://api.github.com/users/Mistuus/followers","following_url":"https://api.github.com/users/Mistuus/following{/other_user}","gists_url":"https://api.github.com/users/Mistuus/gists{/gist_id}","starred_url":"https://api.github.com/users/Mistuus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mistuus/subscriptions","organizations_url":"https://api.github.com/users/Mistuus/orgs","repos_url":"https://api.github.com/users/Mistuus/repos","events_url":"https://api.github.com/users/Mistuus/events{/privacy}","received_events_url":"https://api.github.com/users/Mistuus/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenGamma/Strata/pulls/1839/commits","review_comments_url":"https://api.github.com/repos/OpenGamma/Strata/pulls/1839/comments","review_comment_url":"https://api.github.com/repos/OpenGamma/Strata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenGamma/Strata/issues/1839/comments","statuses_url":"https://api.github.com/repos/OpenGamma/Strata/statuses/a5c66cff120f8962297530b02f741845cbae9d9f","head":{"label":"OpenGamma:topic/immutable-partitions-collector","ref":"topic/immutable-partitions-collector","sha":"a5c66cff120f8962297530b02f741845cbae9d9f","user":{"login":"OpenGamma","id":120064,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDA2NA==","avatar_url":"https://avatars2.githubusercontent.com/u/120064?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"repo":{"id":20882897,"node_id":"MDEwOlJlcG9zaXRvcnkyMDg4Mjg5Nw==","name":"Strata","full_name":"OpenGamma/Strata","private":false,"owner":{"login":"OpenGamma","id":120064,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDA2NA==","avatar_url":"https://avatars2.githubusercontent.com/u/120064?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/OpenGamma/Strata","description":" Open source analytics and market risk library from OpenGamma","fork":false,"url":"https://api.github.com/repos/OpenGamma/Strata","forks_url":"https://api.github.com/repos/OpenGamma/Strata/forks","keys_url":"https://api.github.com/repos/OpenGamma/Strata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGamma/Strata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGamma/Strata/teams","hooks_url":"https://api.github.com/repos/OpenGamma/Strata/hooks","issue_events_url":"https://api.github.com/repos/OpenGamma/Strata/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGamma/Strata/events","assignees_url":"https://api.github.com/repos/OpenGamma/Strata/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGamma/Strata/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGamma/Strata/tags","blobs_url":"https://api.github.com/repos/OpenGamma/Strata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGamma/Strata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGamma/Strata/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGamma/Strata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGamma/Strata/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGamma/Strata/languages","stargazers_url":"https://api.github.com/repos/OpenGamma/Strata/stargazers","contributors_url":"https://api.github.com/repos/OpenGamma/Strata/contributors","subscribers_url":"https://api.github.com/repos/OpenGamma/Strata/subscribers","subscription_url":"https://api.github.com/repos/OpenGamma/Strata/subscription","commits_url":"https://api.github.com/repos/OpenGamma/Strata/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGamma/Strata/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGamma/Strata/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGamma/Strata/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenGamma/Strata/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGamma/Strata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGamma/Strata/merges","archive_url":"https://api.github.com/repos/OpenGamma/Strata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGamma/Strata/downloads","issues_url":"https://api.github.com/repos/OpenGamma/Strata/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGamma/Strata/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGamma/Strata/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGamma/Strata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGamma/Strata/labels{/name}","releases_url":"https://api.github.com/repos/OpenGamma/Strata/releases{/id}","deployments_url":"https://api.github.com/repos/OpenGamma/Strata/deployments","created_at":"2014-06-16T11:45:55Z","updated_at":"2018-11-01T15:16:43Z","pushed_at":"2018-11-02T14:07:15Z","git_url":"git://github.com/OpenGamma/Strata.git","ssh_url":"git@github.com:OpenGamma/Strata.git","clone_url":"https://github.com/OpenGamma/Strata.git","svn_url":"https://github.com/OpenGamma/Strata","homepage":"http://strata.opengamma.io","size":37844,"stargazers_count":383,"watchers_count":383,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":140,"mirror_url":null,"archived":false,"open_issues_count":74,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":140,"open_issues":74,"watchers":383,"default_branch":"master"}},"base":{"label":"OpenGamma:master","ref":"master","sha":"3a4713420f0c305f0da6bb467240fb77adb3716c","user":{"login":"OpenGamma","id":120064,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDA2NA==","avatar_url":"https://avatars2.githubusercontent.com/u/120064?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"repo":{"id":20882897,"node_id":"MDEwOlJlcG9zaXRvcnkyMDg4Mjg5Nw==","name":"Strata","full_name":"OpenGamma/Strata","private":false,"owner":{"login":"OpenGamma","id":120064,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDA2NA==","avatar_url":"https://avatars2.githubusercontent.com/u/120064?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/OpenGamma/Strata","description":" Open source analytics and market risk library from OpenGamma","fork":false,"url":"https://api.github.com/repos/OpenGamma/Strata","forks_url":"https://api.github.com/repos/OpenGamma/Strata/forks","keys_url":"https://api.github.com/repos/OpenGamma/Strata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGamma/Strata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGamma/Strata/teams","hooks_url":"https://api.github.com/repos/OpenGamma/Strata/hooks","issue_events_url":"https://api.github.com/repos/OpenGamma/Strata/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGamma/Strata/events","assignees_url":"https://api.github.com/repos/OpenGamma/Strata/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGamma/Strata/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGamma/Strata/tags","blobs_url":"https://api.github.com/repos/OpenGamma/Strata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGamma/Strata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGamma/Strata/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGamma/Strata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGamma/Strata/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGamma/Strata/languages","stargazers_url":"https://api.github.com/repos/OpenGamma/Strata/stargazers","contributors_url":"https://api.github.com/repos/OpenGamma/Strata/contributors","subscribers_url":"https://api.github.com/repos/OpenGamma/Strata/subscribers","subscription_url":"https://api.github.com/repos/OpenGamma/Strata/subscription","commits_url":"https://api.github.com/repos/OpenGamma/Strata/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGamma/Strata/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGamma/Strata/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGamma/Strata/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenGamma/Strata/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGamma/Strata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGamma/Strata/merges","archive_url":"https://api.github.com/repos/OpenGamma/Strata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGamma/Strata/downloads","issues_url":"https://api.github.com/repos/OpenGamma/Strata/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGamma/Strata/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGamma/Strata/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGamma/Strata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGamma/Strata/labels{/name}","releases_url":"https://api.github.com/repos/OpenGamma/Strata/releases{/id}","deployments_url":"https://api.github.com/repos/OpenGamma/Strata/deployments","created_at":"2014-06-16T11:45:55Z","updated_at":"2018-11-01T15:16:43Z","pushed_at":"2018-11-02T14:07:15Z","git_url":"git://github.com/OpenGamma/Strata.git","ssh_url":"git@github.com:OpenGamma/Strata.git","clone_url":"https://github.com/OpenGamma/Strata.git","svn_url":"https://github.com/OpenGamma/Strata","homepage":"http://strata.opengamma.io","size":37844,"stargazers_count":383,"watchers_count":383,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":140,"mirror_url":null,"archived":false,"open_issues_count":74,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":140,"open_issues":74,"watchers":383,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/1839"},"html":{"href":"https://github.com/OpenGamma/Strata/pull/1839"},"issue":{"href":"https://api.github.com/repos/OpenGamma/Strata/issues/1839"},"comments":{"href":"https://api.github.com/repos/OpenGamma/Strata/issues/1839/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/1839/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/1839/commits"},"statuses":{"href":"https://api.github.com/repos/OpenGamma/Strata/statuses/a5c66cff120f8962297530b02f741845cbae9d9f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Mistuus"}}