{"action":"created","comment":{"url":"https://api.github.com/repos/nizshee/java2016/pulls/comments/59975639","id":59975639,"diff_hunk":"@@ -0,0 +1,82 @@\n+package sp;\n+\n+import java.util.*;\n+import java.util.function.Function;\n+import java.util.stream.Collectors;\n+import java.util.stream.IntStream;\n+import java.util.stream.Stream;\n+\n+public final class FirstPartTasks {\n+\n+    private FirstPartTasks() {\n+    }\n+\n+    // Список названий альбомов\n+    public static List<String> allNames(Stream<Album> albums) {\n+        return albums.map(Album::getName).collect(Collectors.toList());\n+    }\n+\n+    // Список названий альбомов, отсортированный лексикографически по названию\n+    public static List<String> allNamesSorted(Stream<Album> albums) {\n+        return albums.map(Album::getName).sorted().collect(Collectors.toList());\n+    }\n+\n+    // Список треков, отсортированный лексикографически по названию, включающий все треки альбомов из 'albums'\n+    public static List<String> allTracksSorted(Stream<Album> albums) {\n+        return albums.flatMap(album -> album.getTracks().stream().map(Track::getName)).sorted().collect(Collectors.toList());\n+    }\n+\n+    // Список альбомов, в которых есть хотя бы один трек с рейтингом более 95, отсортированный по названию\n+    public static List<Album> sortedFavorites(Stream<Album> albums) {\n+//        return null;\n+        return albums.filter(album -> album.getTracks().stream().anyMatch(track -> track.getRating() > 95))\n+                .sorted(Comparator.comparing(Album::getName)).collect(Collectors.toList());\n+    }\n+\n+    // Сгруппировать альбомы по артистам\n+    public static Map<Artist, List<Album>> groupByArtist(Stream<Album> albums) {\n+        return albums.collect(Collectors.groupingBy(Album::getArtist));\n+    }\n+\n+    // Сгруппировать альбомы по артистам (в качестве значения вместо объекта 'Artist' использовать его имя)\n+    public static Map<Artist, List<String>> groupByArtistMapName(Stream<Album> albums) {\n+        return albums.collect(Collectors.groupingBy(Album::getArtist,\n+                Collectors.mapping(Album::getName, Collectors.toList())));\n+    }\n+\n+    // Число повторяющихся альбомов в потоке\n+    public static long countAlbumDuplicates(Stream<Album> albums) {\n+        return albums.collect(Collectors.toMap(Function.identity(), album -> 1, (a, b) -> a + b)).entrySet().stream()","path":"src/main/java/sp/FirstPartTasks.java","position":49,"original_position":49,"commit_id":"d7f33f3096ea563f6850606d8c5f97ae51060494","original_commit_id":"d7f33f3096ea563f6850606d8c5f97ae51060494","user":{"login":"sproshev","id":4990763,"avatar_url":"https://avatars.githubusercontent.com/u/4990763?v=3","gravatar_id":"","url":"https://api.github.com/users/sproshev","html_url":"https://github.com/sproshev","followers_url":"https://api.github.com/users/sproshev/followers","following_url":"https://api.github.com/users/sproshev/following{/other_user}","gists_url":"https://api.github.com/users/sproshev/gists{/gist_id}","starred_url":"https://api.github.com/users/sproshev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sproshev/subscriptions","organizations_url":"https://api.github.com/users/sproshev/orgs","repos_url":"https://api.github.com/users/sproshev/repos","events_url":"https://api.github.com/users/sproshev/events{/privacy}","received_events_url":"https://api.github.com/users/sproshev/received_events","type":"User","site_admin":false},"body":"albums.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))","created_at":"2016-04-16T23:21:24Z","updated_at":"2016-04-16T23:21:24Z","html_url":"https://github.com/nizshee/java2016/pull/4#discussion_r59975639","pull_request_url":"https://api.github.com/repos/nizshee/java2016/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/nizshee/java2016/pulls/comments/59975639"},"html":{"href":"https://github.com/nizshee/java2016/pull/4#discussion_r59975639"},"pull_request":{"href":"https://api.github.com/repos/nizshee/java2016/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/nizshee/java2016/pulls/4","id":65855654,"html_url":"https://github.com/nizshee/java2016/pull/4","diff_url":"https://github.com/nizshee/java2016/pull/4.diff","patch_url":"https://github.com/nizshee/java2016/pull/4.patch","issue_url":"https://api.github.com/repos/nizshee/java2016/issues/4","number":4,"state":"open","locked":false,"title":" Java05. ДЗ 04, Васильев Роман","user":{"login":"nizshee","id":8837119,"avatar_url":"https://avatars.githubusercontent.com/u/8837119?v=3","gravatar_id":"","url":"https://api.github.com/users/nizshee","html_url":"https://github.com/nizshee","followers_url":"https://api.github.com/users/nizshee/followers","following_url":"https://api.github.com/users/nizshee/following{/other_user}","gists_url":"https://api.github.com/users/nizshee/gists{/gist_id}","starred_url":"https://api.github.com/users/nizshee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nizshee/subscriptions","organizations_url":"https://api.github.com/users/nizshee/orgs","repos_url":"https://api.github.com/users/nizshee/repos","events_url":"https://api.github.com/users/nizshee/events{/privacy}","received_events_url":"https://api.github.com/users/nizshee/received_events","type":"User","site_admin":false},"body":"@sproshev","created_at":"2016-04-08T22:24:12Z","updated_at":"2016-04-16T23:21:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c823e364b6ca8f7588f81f651eff80a55f208477","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nizshee/java2016/pulls/4/commits","review_comments_url":"https://api.github.com/repos/nizshee/java2016/pulls/4/comments","review_comment_url":"https://api.github.com/repos/nizshee/java2016/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nizshee/java2016/issues/4/comments","statuses_url":"https://api.github.com/repos/nizshee/java2016/statuses/d7f33f3096ea563f6850606d8c5f97ae51060494","head":{"label":"nizshee:task4","ref":"task4","sha":"d7f33f3096ea563f6850606d8c5f97ae51060494","user":{"login":"nizshee","id":8837119,"avatar_url":"https://avatars.githubusercontent.com/u/8837119?v=3","gravatar_id":"","url":"https://api.github.com/users/nizshee","html_url":"https://github.com/nizshee","followers_url":"https://api.github.com/users/nizshee/followers","following_url":"https://api.github.com/users/nizshee/following{/other_user}","gists_url":"https://api.github.com/users/nizshee/gists{/gist_id}","starred_url":"https://api.github.com/users/nizshee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nizshee/subscriptions","organizations_url":"https://api.github.com/users/nizshee/orgs","repos_url":"https://api.github.com/users/nizshee/repos","events_url":"https://api.github.com/users/nizshee/events{/privacy}","received_events_url":"https://api.github.com/users/nizshee/received_events","type":"User","site_admin":false},"repo":{"id":52625582,"name":"java2016","full_name":"nizshee/java2016","owner":{"login":"nizshee","id":8837119,"avatar_url":"https://avatars.githubusercontent.com/u/8837119?v=3","gravatar_id":"","url":"https://api.github.com/users/nizshee","html_url":"https://github.com/nizshee","followers_url":"https://api.github.com/users/nizshee/followers","following_url":"https://api.github.com/users/nizshee/following{/other_user}","gists_url":"https://api.github.com/users/nizshee/gists{/gist_id}","starred_url":"https://api.github.com/users/nizshee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nizshee/subscriptions","organizations_url":"https://api.github.com/users/nizshee/orgs","repos_url":"https://api.github.com/users/nizshee/repos","events_url":"https://api.github.com/users/nizshee/events{/privacy}","received_events_url":"https://api.github.com/users/nizshee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nizshee/java2016","description":"","fork":false,"url":"https://api.github.com/repos/nizshee/java2016","forks_url":"https://api.github.com/repos/nizshee/java2016/forks","keys_url":"https://api.github.com/repos/nizshee/java2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nizshee/java2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nizshee/java2016/teams","hooks_url":"https://api.github.com/repos/nizshee/java2016/hooks","issue_events_url":"https://api.github.com/repos/nizshee/java2016/issues/events{/number}","events_url":"https://api.github.com/repos/nizshee/java2016/events","assignees_url":"https://api.github.com/repos/nizshee/java2016/assignees{/user}","branches_url":"https://api.github.com/repos/nizshee/java2016/branches{/branch}","tags_url":"https://api.github.com/repos/nizshee/java2016/tags","blobs_url":"https://api.github.com/repos/nizshee/java2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nizshee/java2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nizshee/java2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/nizshee/java2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nizshee/java2016/statuses/{sha}","languages_url":"https://api.github.com/repos/nizshee/java2016/languages","stargazers_url":"https://api.github.com/repos/nizshee/java2016/stargazers","contributors_url":"https://api.github.com/repos/nizshee/java2016/contributors","subscribers_url":"https://api.github.com/repos/nizshee/java2016/subscribers","subscription_url":"https://api.github.com/repos/nizshee/java2016/subscription","commits_url":"https://api.github.com/repos/nizshee/java2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/nizshee/java2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/nizshee/java2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/nizshee/java2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/nizshee/java2016/contents/{+path}","compare_url":"https://api.github.com/repos/nizshee/java2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nizshee/java2016/merges","archive_url":"https://api.github.com/repos/nizshee/java2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nizshee/java2016/downloads","issues_url":"https://api.github.com/repos/nizshee/java2016/issues{/number}","pulls_url":"https://api.github.com/repos/nizshee/java2016/pulls{/number}","milestones_url":"https://api.github.com/repos/nizshee/java2016/milestones{/number}","notifications_url":"https://api.github.com/repos/nizshee/java2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nizshee/java2016/labels{/name}","releases_url":"https://api.github.com/repos/nizshee/java2016/releases{/id}","deployments_url":"https://api.github.com/repos/nizshee/java2016/deployments","created_at":"2016-02-26T18:52:50Z","updated_at":"2016-02-26T18:52:50Z","pushed_at":"2016-04-08T22:24:12Z","git_url":"git://github.com/nizshee/java2016.git","ssh_url":"git@github.com:nizshee/java2016.git","clone_url":"https://github.com/nizshee/java2016.git","svn_url":"https://github.com/nizshee/java2016","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"nizshee:master","ref":"master","sha":"fedef15e7476cf42113c8d12c79c9db445cbe620","user":{"login":"nizshee","id":8837119,"avatar_url":"https://avatars.githubusercontent.com/u/8837119?v=3","gravatar_id":"","url":"https://api.github.com/users/nizshee","html_url":"https://github.com/nizshee","followers_url":"https://api.github.com/users/nizshee/followers","following_url":"https://api.github.com/users/nizshee/following{/other_user}","gists_url":"https://api.github.com/users/nizshee/gists{/gist_id}","starred_url":"https://api.github.com/users/nizshee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nizshee/subscriptions","organizations_url":"https://api.github.com/users/nizshee/orgs","repos_url":"https://api.github.com/users/nizshee/repos","events_url":"https://api.github.com/users/nizshee/events{/privacy}","received_events_url":"https://api.github.com/users/nizshee/received_events","type":"User","site_admin":false},"repo":{"id":52625582,"name":"java2016","full_name":"nizshee/java2016","owner":{"login":"nizshee","id":8837119,"avatar_url":"https://avatars.githubusercontent.com/u/8837119?v=3","gravatar_id":"","url":"https://api.github.com/users/nizshee","html_url":"https://github.com/nizshee","followers_url":"https://api.github.com/users/nizshee/followers","following_url":"https://api.github.com/users/nizshee/following{/other_user}","gists_url":"https://api.github.com/users/nizshee/gists{/gist_id}","starred_url":"https://api.github.com/users/nizshee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nizshee/subscriptions","organizations_url":"https://api.github.com/users/nizshee/orgs","repos_url":"https://api.github.com/users/nizshee/repos","events_url":"https://api.github.com/users/nizshee/events{/privacy}","received_events_url":"https://api.github.com/users/nizshee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nizshee/java2016","description":"","fork":false,"url":"https://api.github.com/repos/nizshee/java2016","forks_url":"https://api.github.com/repos/nizshee/java2016/forks","keys_url":"https://api.github.com/repos/nizshee/java2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nizshee/java2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nizshee/java2016/teams","hooks_url":"https://api.github.com/repos/nizshee/java2016/hooks","issue_events_url":"https://api.github.com/repos/nizshee/java2016/issues/events{/number}","events_url":"https://api.github.com/repos/nizshee/java2016/events","assignees_url":"https://api.github.com/repos/nizshee/java2016/assignees{/user}","branches_url":"https://api.github.com/repos/nizshee/java2016/branches{/branch}","tags_url":"https://api.github.com/repos/nizshee/java2016/tags","blobs_url":"https://api.github.com/repos/nizshee/java2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nizshee/java2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nizshee/java2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/nizshee/java2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nizshee/java2016/statuses/{sha}","languages_url":"https://api.github.com/repos/nizshee/java2016/languages","stargazers_url":"https://api.github.com/repos/nizshee/java2016/stargazers","contributors_url":"https://api.github.com/repos/nizshee/java2016/contributors","subscribers_url":"https://api.github.com/repos/nizshee/java2016/subscribers","subscription_url":"https://api.github.com/repos/nizshee/java2016/subscription","commits_url":"https://api.github.com/repos/nizshee/java2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/nizshee/java2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/nizshee/java2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/nizshee/java2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/nizshee/java2016/contents/{+path}","compare_url":"https://api.github.com/repos/nizshee/java2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nizshee/java2016/merges","archive_url":"https://api.github.com/repos/nizshee/java2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nizshee/java2016/downloads","issues_url":"https://api.github.com/repos/nizshee/java2016/issues{/number}","pulls_url":"https://api.github.com/repos/nizshee/java2016/pulls{/number}","milestones_url":"https://api.github.com/repos/nizshee/java2016/milestones{/number}","notifications_url":"https://api.github.com/repos/nizshee/java2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nizshee/java2016/labels{/name}","releases_url":"https://api.github.com/repos/nizshee/java2016/releases{/id}","deployments_url":"https://api.github.com/repos/nizshee/java2016/deployments","created_at":"2016-02-26T18:52:50Z","updated_at":"2016-02-26T18:52:50Z","pushed_at":"2016-04-08T22:24:12Z","git_url":"git://github.com/nizshee/java2016.git","ssh_url":"git@github.com:nizshee/java2016.git","clone_url":"https://github.com/nizshee/java2016.git","svn_url":"https://github.com/nizshee/java2016","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nizshee/java2016/pulls/4"},"html":{"href":"https://github.com/nizshee/java2016/pull/4"},"issue":{"href":"https://api.github.com/repos/nizshee/java2016/issues/4"},"comments":{"href":"https://api.github.com/repos/nizshee/java2016/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/nizshee/java2016/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/nizshee/java2016/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nizshee/java2016/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/nizshee/java2016/statuses/d7f33f3096ea563f6850606d8c5f97ae51060494"}}}}