{"action":"created","comment":{"url":"https://api.github.com/repos/jelem/homework/pulls/comments/100703683","pull_request_review_id":21417023,"id":100703683,"diff_hunk":"@@ -0,0 +1,172 @@\n+package com.hillel.linkedlist;\n+\n+import java.util.EmptyStackException;\n+import java.util.Iterator;\n+import java.util.NoSuchElementException;\n+import java.util.StringJoiner;\n+\n+public class CustomLinkedList implements Iterable {\n+  Node first;\n+  int count;\n+  Node last;\n+\n+  public void add(int data) {\n+    Node node = new Node(data);\n+    if (last == null) {\n+      first = node;\n+      last = node;\n+    } else {\n+      last.next = node;\n+      last = node;\n+    }\n+    count++;\n+  }\n+\n+  public int get(int position) {\n+    int currentIndex = 1;\n+    Node current = first;\n+    if (current == null) {\n+      throw new EmptyStackException();\n+    }\n+    if (position < 0 || position >= count) {\n+      throw new IllegalArgumentException();\n+    }\n+    while (currentIndex <= position) {\n+      currentIndex++;\n+      current = current.next;\n+    }\n+\n+    return current.data;\n+  }\n+\n+  public void remove() {\n+    if (first != null) {\n+      Node temp = first.next;\n+      first = temp;\n+      count--;\n+    } else {\n+      throw new EmptyStackException();\n+    }\n+    if (count == 0) {\n+      last = null;\n+    }\n+  }\n+\n+  public void introduceCycle(int index) {\n+    Node current = first;\n+    for (int i = 1; i <= index; i++) {\n+      current = current.next;\n+    }\n+    last.next = current;\n+  }\n+\n+  public boolean hasCycle() {\n+    Node current = first;\n+    for (int i = 1; i < count; i++) {","path":"task_18/toma.lobanova/src/main/java/com/hillel/linkedlist/CustomLinkedList.java","position":65,"original_position":65,"commit_id":"00eb9de3b2a44065f0f82b5b7dcc4cc20b446eca","original_commit_id":"00eb9de3b2a44065f0f82b5b7dcc4cc20b446eca","user":{"login":"parkhomenko","id":3454949,"avatar_url":"https://avatars.githubusercontent.com/u/3454949?v=3","gravatar_id":"","url":"https://api.github.com/users/parkhomenko","html_url":"https://github.com/parkhomenko","followers_url":"https://api.github.com/users/parkhomenko/followers","following_url":"https://api.github.com/users/parkhomenko/following{/other_user}","gists_url":"https://api.github.com/users/parkhomenko/gists{/gist_id}","starred_url":"https://api.github.com/users/parkhomenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parkhomenko/subscriptions","organizations_url":"https://api.github.com/users/parkhomenko/orgs","repos_url":"https://api.github.com/users/parkhomenko/repos","events_url":"https://api.github.com/users/parkhomenko/events{/privacy}","received_events_url":"https://api.github.com/users/parkhomenko/received_events","type":"User","site_admin":false},"body":"Forgot to mention that for this function we assume that the number of elements is unknown. That would be to easy ;)","created_at":"2017-02-12T20:37:31Z","updated_at":"2017-02-12T20:37:31Z","html_url":"https://github.com/jelem/homework/pull/70#discussion_r100703683","pull_request_url":"https://api.github.com/repos/jelem/homework/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/jelem/homework/pulls/comments/100703683"},"html":{"href":"https://github.com/jelem/homework/pull/70#discussion_r100703683"},"pull_request":{"href":"https://api.github.com/repos/jelem/homework/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/jelem/homework/pulls/70","id":105339954,"html_url":"https://github.com/jelem/homework/pull/70","diff_url":"https://github.com/jelem/homework/pull/70.diff","patch_url":"https://github.com/jelem/homework/pull/70.patch","issue_url":"https://api.github.com/repos/jelem/homework/issues/70","number":70,"state":"open","locked":false,"title":"Task_17","user":{"login":"totomka","id":24461553,"avatar_url":"https://avatars.githubusercontent.com/u/24461553?v=3","gravatar_id":"","url":"https://api.github.com/users/totomka","html_url":"https://github.com/totomka","followers_url":"https://api.github.com/users/totomka/followers","following_url":"https://api.github.com/users/totomka/following{/other_user}","gists_url":"https://api.github.com/users/totomka/gists{/gist_id}","starred_url":"https://api.github.com/users/totomka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totomka/subscriptions","organizations_url":"https://api.github.com/users/totomka/orgs","repos_url":"https://api.github.com/users/totomka/repos","events_url":"https://api.github.com/users/totomka/events{/privacy}","received_events_url":"https://api.github.com/users/totomka/received_events","type":"User","site_admin":false},"body":"Hi Stas) Here is my task 17. I will be waiting for your comments. Thank you!","created_at":"2017-02-09T00:59:16Z","updated_at":"2017-02-12T20:37:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17e50a4eccbc2cdfdf66fe5ee385e9dec232b906","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jelem/homework/pulls/70/commits","review_comments_url":"https://api.github.com/repos/jelem/homework/pulls/70/comments","review_comment_url":"https://api.github.com/repos/jelem/homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jelem/homework/issues/70/comments","statuses_url":"https://api.github.com/repos/jelem/homework/statuses/00eb9de3b2a44065f0f82b5b7dcc4cc20b446eca","head":{"label":"totomka:master","ref":"master","sha":"00eb9de3b2a44065f0f82b5b7dcc4cc20b446eca","user":{"login":"totomka","id":24461553,"avatar_url":"https://avatars.githubusercontent.com/u/24461553?v=3","gravatar_id":"","url":"https://api.github.com/users/totomka","html_url":"https://github.com/totomka","followers_url":"https://api.github.com/users/totomka/followers","following_url":"https://api.github.com/users/totomka/following{/other_user}","gists_url":"https://api.github.com/users/totomka/gists{/gist_id}","starred_url":"https://api.github.com/users/totomka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totomka/subscriptions","organizations_url":"https://api.github.com/users/totomka/orgs","repos_url":"https://api.github.com/users/totomka/repos","events_url":"https://api.github.com/users/totomka/events{/privacy}","received_events_url":"https://api.github.com/users/totomka/received_events","type":"User","site_admin":false},"repo":{"id":76718350,"name":"homework","full_name":"totomka/homework","owner":{"login":"totomka","id":24461553,"avatar_url":"https://avatars.githubusercontent.com/u/24461553?v=3","gravatar_id":"","url":"https://api.github.com/users/totomka","html_url":"https://github.com/totomka","followers_url":"https://api.github.com/users/totomka/followers","following_url":"https://api.github.com/users/totomka/following{/other_user}","gists_url":"https://api.github.com/users/totomka/gists{/gist_id}","starred_url":"https://api.github.com/users/totomka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totomka/subscriptions","organizations_url":"https://api.github.com/users/totomka/orgs","repos_url":"https://api.github.com/users/totomka/repos","events_url":"https://api.github.com/users/totomka/events{/privacy}","received_events_url":"https://api.github.com/users/totomka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/totomka/homework","description":null,"fork":true,"url":"https://api.github.com/repos/totomka/homework","forks_url":"https://api.github.com/repos/totomka/homework/forks","keys_url":"https://api.github.com/repos/totomka/homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/totomka/homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/totomka/homework/teams","hooks_url":"https://api.github.com/repos/totomka/homework/hooks","issue_events_url":"https://api.github.com/repos/totomka/homework/issues/events{/number}","events_url":"https://api.github.com/repos/totomka/homework/events","assignees_url":"https://api.github.com/repos/totomka/homework/assignees{/user}","branches_url":"https://api.github.com/repos/totomka/homework/branches{/branch}","tags_url":"https://api.github.com/repos/totomka/homework/tags","blobs_url":"https://api.github.com/repos/totomka/homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/totomka/homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/totomka/homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/totomka/homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/totomka/homework/statuses/{sha}","languages_url":"https://api.github.com/repos/totomka/homework/languages","stargazers_url":"https://api.github.com/repos/totomka/homework/stargazers","contributors_url":"https://api.github.com/repos/totomka/homework/contributors","subscribers_url":"https://api.github.com/repos/totomka/homework/subscribers","subscription_url":"https://api.github.com/repos/totomka/homework/subscription","commits_url":"https://api.github.com/repos/totomka/homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/totomka/homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/totomka/homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/totomka/homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/totomka/homework/contents/{+path}","compare_url":"https://api.github.com/repos/totomka/homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/totomka/homework/merges","archive_url":"https://api.github.com/repos/totomka/homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/totomka/homework/downloads","issues_url":"https://api.github.com/repos/totomka/homework/issues{/number}","pulls_url":"https://api.github.com/repos/totomka/homework/pulls{/number}","milestones_url":"https://api.github.com/repos/totomka/homework/milestones{/number}","notifications_url":"https://api.github.com/repos/totomka/homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/totomka/homework/labels{/name}","releases_url":"https://api.github.com/repos/totomka/homework/releases{/id}","deployments_url":"https://api.github.com/repos/totomka/homework/deployments","created_at":"2016-12-17T10:42:24Z","updated_at":"2016-12-18T23:09:34Z","pushed_at":"2017-02-10T17:20:30Z","git_url":"git://github.com/totomka/homework.git","ssh_url":"git@github.com:totomka/homework.git","clone_url":"https://github.com/totomka/homework.git","svn_url":"https://github.com/totomka/homework","homepage":null,"size":886,"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":"jelem:master","ref":"master","sha":"cd683e14619c95ca4e9ff3393b33744c18b8788b","user":{"login":"jelem","id":24527420,"avatar_url":"https://avatars.githubusercontent.com/u/24527420?v=3","gravatar_id":"","url":"https://api.github.com/users/jelem","html_url":"https://github.com/jelem","followers_url":"https://api.github.com/users/jelem/followers","following_url":"https://api.github.com/users/jelem/following{/other_user}","gists_url":"https://api.github.com/users/jelem/gists{/gist_id}","starred_url":"https://api.github.com/users/jelem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelem/subscriptions","organizations_url":"https://api.github.com/users/jelem/orgs","repos_url":"https://api.github.com/users/jelem/repos","events_url":"https://api.github.com/users/jelem/events{/privacy}","received_events_url":"https://api.github.com/users/jelem/received_events","type":"Organization","site_admin":false},"repo":{"id":76594666,"name":"homework","full_name":"jelem/homework","owner":{"login":"jelem","id":24527420,"avatar_url":"https://avatars.githubusercontent.com/u/24527420?v=3","gravatar_id":"","url":"https://api.github.com/users/jelem","html_url":"https://github.com/jelem","followers_url":"https://api.github.com/users/jelem/followers","following_url":"https://api.github.com/users/jelem/following{/other_user}","gists_url":"https://api.github.com/users/jelem/gists{/gist_id}","starred_url":"https://api.github.com/users/jelem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelem/subscriptions","organizations_url":"https://api.github.com/users/jelem/orgs","repos_url":"https://api.github.com/users/jelem/repos","events_url":"https://api.github.com/users/jelem/events{/privacy}","received_events_url":"https://api.github.com/users/jelem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jelem/homework","description":null,"fork":false,"url":"https://api.github.com/repos/jelem/homework","forks_url":"https://api.github.com/repos/jelem/homework/forks","keys_url":"https://api.github.com/repos/jelem/homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jelem/homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jelem/homework/teams","hooks_url":"https://api.github.com/repos/jelem/homework/hooks","issue_events_url":"https://api.github.com/repos/jelem/homework/issues/events{/number}","events_url":"https://api.github.com/repos/jelem/homework/events","assignees_url":"https://api.github.com/repos/jelem/homework/assignees{/user}","branches_url":"https://api.github.com/repos/jelem/homework/branches{/branch}","tags_url":"https://api.github.com/repos/jelem/homework/tags","blobs_url":"https://api.github.com/repos/jelem/homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jelem/homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jelem/homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/jelem/homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jelem/homework/statuses/{sha}","languages_url":"https://api.github.com/repos/jelem/homework/languages","stargazers_url":"https://api.github.com/repos/jelem/homework/stargazers","contributors_url":"https://api.github.com/repos/jelem/homework/contributors","subscribers_url":"https://api.github.com/repos/jelem/homework/subscribers","subscription_url":"https://api.github.com/repos/jelem/homework/subscription","commits_url":"https://api.github.com/repos/jelem/homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/jelem/homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/jelem/homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/jelem/homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/jelem/homework/contents/{+path}","compare_url":"https://api.github.com/repos/jelem/homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jelem/homework/merges","archive_url":"https://api.github.com/repos/jelem/homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jelem/homework/downloads","issues_url":"https://api.github.com/repos/jelem/homework/issues{/number}","pulls_url":"https://api.github.com/repos/jelem/homework/pulls{/number}","milestones_url":"https://api.github.com/repos/jelem/homework/milestones{/number}","notifications_url":"https://api.github.com/repos/jelem/homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jelem/homework/labels{/name}","releases_url":"https://api.github.com/repos/jelem/homework/releases{/id}","deployments_url":"https://api.github.com/repos/jelem/homework/deployments","created_at":"2016-12-15T20:43:28Z","updated_at":"2017-01-23T19:38:00Z","pushed_at":"2017-02-12T20:29:14Z","git_url":"git://github.com/jelem/homework.git","ssh_url":"git@github.com:jelem/homework.git","clone_url":"https://github.com/jelem/homework.git","svn_url":"https://github.com/jelem/homework","homepage":null,"size":878,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":6,"forks":14,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jelem/homework/pulls/70"},"html":{"href":"https://github.com/jelem/homework/pull/70"},"issue":{"href":"https://api.github.com/repos/jelem/homework/issues/70"},"comments":{"href":"https://api.github.com/repos/jelem/homework/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/jelem/homework/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/jelem/homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jelem/homework/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/jelem/homework/statuses/00eb9de3b2a44065f0f82b5b7dcc4cc20b446eca"}}}}
{"actor":{"display_login":"parkhomenko"}}