{"action":"created","comment":{"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments/229185640","pull_request_review_id":169623495,"id":229185640,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTE4NTY0MA==","diff_hunk":"@@ -0,0 +1,101 @@\n+package ru.unn.agile.huffman.model;\n+\n+import java.util.HashMap;\n+import java.util.Map;\n+import java.util.Objects;\n+import java.util.PriorityQueue;\n+import java.util.stream.Collectors;\n+\n+import ru.unn.agile.huffman.model.node.*;\n+\n+public class Huffman {\n+    private String encodedString;\n+    private String decodedString;\n+\n+    public static final String CODE_0 = \"0\";\n+    public static final String CODE_1 = \"1\";\n+\n+    private Map<Character, Node> buildAlphabet() {\n+        Map<Character, Integer> numberOfAppearances = new HashMap<>();\n+        Map<Character, Node> alphabet = new HashMap<>();\n+\n+        decodedString.chars().forEach(charElem -> {\n+            if (numberOfAppearances.containsKey((char) charElem)) {\n+                numberOfAppearances.put((char) charElem,\n+                        numberOfAppearances.get((char) charElem) + 1);\n+            } else {\n+                numberOfAppearances.put((char) charElem, 1);\n+            }\n+        });\n+\n+        numberOfAppearances.entrySet().forEach(entry -> {\n+            alphabet.put(entry.getKey(), new Node(entry.getValue()));\n+        });\n+\n+        return alphabet;\n+    }\n+\n+    public Huffman(final String str) {\n+        decodedString = str;\n+        if (\"\".equals(decodedString)) {","path":"code/gladkov-dmitry-huffman/src/main/java/ru/unn/agile/huffman/model/Huffman.java","position":40,"original_position":40,"commit_id":"47030b4006b13e737abe095be114533a19064c62","original_commit_id":"47030b4006b13e737abe095be114533a19064c62","user":{"login":"dmitrygladkov","id":11650339,"node_id":"MDQ6VXNlcjExNjUwMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/11650339?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitrygladkov","html_url":"https://github.com/dmitrygladkov","followers_url":"https://api.github.com/users/dmitrygladkov/followers","following_url":"https://api.github.com/users/dmitrygladkov/following{/other_user}","gists_url":"https://api.github.com/users/dmitrygladkov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitrygladkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitrygladkov/subscriptions","organizations_url":"https://api.github.com/users/dmitrygladkov/orgs","repos_url":"https://api.github.com/users/dmitrygladkov/repos","events_url":"https://api.github.com/users/dmitrygladkov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitrygladkov/received_events","type":"User","site_admin":false},"body":"Мб NPE оставим? Я думаю тут кидание NPE логично и информативно в достаточной мере","created_at":"2018-10-30T06:11:46Z","updated_at":"2018-10-30T06:11:46Z","html_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/23#discussion_r229185640","pull_request_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/23","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments/229185640"},"html":{"href":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/23#discussion_r229185640"},"pull_request":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/23"}},"in_reply_to_id":229077191},"pull_request":{"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/23","id":224563699,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NTYzNjk5","html_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/23","diff_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/23.diff","patch_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/23.patch","issue_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/23","number":23,"state":"open","locked":false,"title":"Гладков -- Лабораторная работа #1","user":{"login":"dmitrygladkov","id":11650339,"node_id":"MDQ6VXNlcjExNjUwMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/11650339?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitrygladkov","html_url":"https://github.com/dmitrygladkov","followers_url":"https://api.github.com/users/dmitrygladkov/followers","following_url":"https://api.github.com/users/dmitrygladkov/following{/other_user}","gists_url":"https://api.github.com/users/dmitrygladkov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitrygladkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitrygladkov/subscriptions","organizations_url":"https://api.github.com/users/dmitrygladkov/orgs","repos_url":"https://api.github.com/users/dmitrygladkov/repos","events_url":"https://api.github.com/users/dmitrygladkov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitrygladkov/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-21T19:36:07Z","updated_at":"2018-10-30T06:11:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aaa960de1944620ea65d7ff394dfd3179c207b3c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/23/commits","review_comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/23/comments","review_comment_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/23/comments","statuses_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/47030b4006b13e737abe095be114533a19064c62","head":{"label":"dmitrygladkov:lab1-tdd-huffman","ref":"lab1-tdd-huffman","sha":"47030b4006b13e737abe095be114533a19064c62","user":{"login":"dmitrygladkov","id":11650339,"node_id":"MDQ6VXNlcjExNjUwMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/11650339?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitrygladkov","html_url":"https://github.com/dmitrygladkov","followers_url":"https://api.github.com/users/dmitrygladkov/followers","following_url":"https://api.github.com/users/dmitrygladkov/following{/other_user}","gists_url":"https://api.github.com/users/dmitrygladkov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitrygladkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitrygladkov/subscriptions","organizations_url":"https://api.github.com/users/dmitrygladkov/orgs","repos_url":"https://api.github.com/users/dmitrygladkov/repos","events_url":"https://api.github.com/users/dmitrygladkov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitrygladkov/received_events","type":"User","site_admin":false},"repo":{"id":153003598,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwMDM1OTg=","name":"agile-course-practice","full_name":"dmitrygladkov/agile-course-practice","private":false,"owner":{"login":"dmitrygladkov","id":11650339,"node_id":"MDQ6VXNlcjExNjUwMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/11650339?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitrygladkov","html_url":"https://github.com/dmitrygladkov","followers_url":"https://api.github.com/users/dmitrygladkov/followers","following_url":"https://api.github.com/users/dmitrygladkov/following{/other_user}","gists_url":"https://api.github.com/users/dmitrygladkov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitrygladkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitrygladkov/subscriptions","organizations_url":"https://api.github.com/users/dmitrygladkov/orgs","repos_url":"https://api.github.com/users/dmitrygladkov/repos","events_url":"https://api.github.com/users/dmitrygladkov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitrygladkov/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dmitrygladkov/agile-course-practice","description":"Practice for master course on Agile Development","fork":true,"url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice","forks_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/forks","keys_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/teams","hooks_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/hooks","issue_events_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/issues/events{/number}","events_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/events","assignees_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/assignees{/user}","branches_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/branches{/branch}","tags_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/tags","blobs_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/statuses/{sha}","languages_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/languages","stargazers_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/stargazers","contributors_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/contributors","subscribers_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/subscribers","subscription_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/subscription","commits_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/contents/{+path}","compare_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/merges","archive_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/downloads","issues_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/issues{/number}","pulls_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/pulls{/number}","milestones_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/milestones{/number}","notifications_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/labels{/name}","releases_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/releases{/id}","deployments_url":"https://api.github.com/repos/dmitrygladkov/agile-course-practice/deployments","created_at":"2018-10-14T18:06:56Z","updated_at":"2018-10-14T18:06:58Z","pushed_at":"2018-10-29T19:17:12Z","git_url":"git://github.com/dmitrygladkov/agile-course-practice.git","ssh_url":"git@github.com:dmitrygladkov/agile-course-practice.git","clone_url":"https://github.com/dmitrygladkov/agile-course-practice.git","svn_url":"https://github.com/dmitrygladkov/agile-course-practice","homepage":"","size":305,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"UNN-VMK-Software:master","ref":"master","sha":"2e7b6f1939c90d05fe570cb533ed99f250c9f4b4","user":{"login":"UNN-VMK-Software","id":5463209,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NjMyMDk=","avatar_url":"https://avatars2.githubusercontent.com/u/5463209?v=4","gravatar_id":"","url":"https://api.github.com/users/UNN-VMK-Software","html_url":"https://github.com/UNN-VMK-Software","followers_url":"https://api.github.com/users/UNN-VMK-Software/followers","following_url":"https://api.github.com/users/UNN-VMK-Software/following{/other_user}","gists_url":"https://api.github.com/users/UNN-VMK-Software/gists{/gist_id}","starred_url":"https://api.github.com/users/UNN-VMK-Software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNN-VMK-Software/subscriptions","organizations_url":"https://api.github.com/users/UNN-VMK-Software/orgs","repos_url":"https://api.github.com/users/UNN-VMK-Software/repos","events_url":"https://api.github.com/users/UNN-VMK-Software/events{/privacy}","received_events_url":"https://api.github.com/users/UNN-VMK-Software/received_events","type":"Organization","site_admin":false},"repo":{"id":152223946,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyMjM5NDY=","name":"agile-course-practice","full_name":"UNN-VMK-Software/agile-course-practice","private":false,"owner":{"login":"UNN-VMK-Software","id":5463209,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NjMyMDk=","avatar_url":"https://avatars2.githubusercontent.com/u/5463209?v=4","gravatar_id":"","url":"https://api.github.com/users/UNN-VMK-Software","html_url":"https://github.com/UNN-VMK-Software","followers_url":"https://api.github.com/users/UNN-VMK-Software/followers","following_url":"https://api.github.com/users/UNN-VMK-Software/following{/other_user}","gists_url":"https://api.github.com/users/UNN-VMK-Software/gists{/gist_id}","starred_url":"https://api.github.com/users/UNN-VMK-Software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNN-VMK-Software/subscriptions","organizations_url":"https://api.github.com/users/UNN-VMK-Software/orgs","repos_url":"https://api.github.com/users/UNN-VMK-Software/repos","events_url":"https://api.github.com/users/UNN-VMK-Software/events{/privacy}","received_events_url":"https://api.github.com/users/UNN-VMK-Software/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/UNN-VMK-Software/agile-course-practice","description":"Practice for master course on Agile Development","fork":false,"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice","forks_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/forks","keys_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/teams","hooks_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/hooks","issue_events_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/events{/number}","events_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/events","assignees_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/assignees{/user}","branches_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/branches{/branch}","tags_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/tags","blobs_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/refs{/sha}","trees_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/{sha}","languages_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/languages","stargazers_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/stargazers","contributors_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/contributors","subscribers_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/subscribers","subscription_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/subscription","commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/commits{/sha}","git_commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/commits{/sha}","comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/comments{/number}","issue_comment_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/comments{/number}","contents_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/contents/{+path}","compare_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/merges","archive_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/downloads","issues_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues{/number}","pulls_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls{/number}","milestones_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/milestones{/number}","notifications_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/labels{/name}","releases_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/releases{/id}","deployments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/deployments","created_at":"2018-10-09T09:25:36Z","updated_at":"2018-10-30T05:54:28Z","pushed_at":"2018-10-30T05:54:24Z","git_url":"git://github.com/UNN-VMK-Software/agile-course-practice.git","ssh_url":"git@github.com:UNN-VMK-Software/agile-course-practice.git","clone_url":"https://github.com/UNN-VMK-Software/agile-course-practice.git","svn_url":"https://github.com/UNN-VMK-Software/agile-course-practice","homepage":"","size":356,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":40,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/23"},"html":{"href":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/23"},"issue":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/23"},"comments":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/47030b4006b13e737abe095be114533a19064c62"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dmitrygladkov"}}