{"action":"created","comment":{"url":"https://api.github.com/repos/clouway-incubator/collections/pulls/comments/66439287","id":66439287,"diff_hunk":"@@ -0,0 +1,99 @@\n+package firsttask;\n+\n+import java.util.*;\n+\n+/**\n+ * Created by clouway on 31.05.16.\n+ */\n+public class PageBean {\n+\n+    private int currentPage = 1;\n+    private int pageSize = 0;\n+    private List<String> lnklist;\n+\n+\n+\n+    public PageBean(List<String> lnklist, int pageSize) {\n+        this.lnklist = lnklist;\n+        this.pageSize = pageSize;\n+\n+    }\n+\n+    public List<String> next() throws  NoNextPagesFoundException {\n+        int next = (currentPage - 1) * pageSize;\n+        int nextone = ((currentPage - 1) * pageSize) + pageSize;\n+        currentPage += 1;\n+        if (nextone > lnklist.size()) {\n+            nextone = lnklist.size();\n+        }\n+        if (next > nextone) {\n+            throw  new NoNextPagesFoundException();\n+        }\n+        return lnklist.subList(next, nextone);\n+\n+    }\n+\n+\n+    public List<String> previous() throws NoPreviousPagesFoundException {\n+\n+        int previous = (currentPage - 1) * pageSize - pageSize;\n+        int previousone = ((currentPage - 1) * pageSize) - (pageSize + pageSize);\n+        currentPage -=1;\n+        if (previousone > lnklist.size()) {\n+            previousone = lnklist.size();\n+\n+\n+        }\n+        if(previousone < -1){\n+            throw new NoPreviousPagesFoundException();\n+        }\n+\n+        return lnklist.subList(previousone, previous);\n+\n+    }\n+\n+\n+    private String hasNext() {\n+        String str1 = \"We have next elements\";\n+        String str = \"We dont have next elements\";\n+        if (pageSize < lnklist.size()) {\n+            return str1;\n+        } else {\n+            return str;\n+        }\n+\n+    }\n+\n+\n+    public String hasPrevious() {\n+        String str1 = \"We have previous elements\";\n+        String str = \"There is no previous elements\";\n+        if (lnklist.size() < pageSize) {\n+            return str1;\n+        } else {\n+            return str;\n+        }\n+    }\n+\n+    public List<String> firstPage() {\n+        currentPage = 1;\n+        return lnklist.subList(0, pageSize);","path":"src/firsttask/PageBean.java","position":null,"original_position":80,"commit_id":"bda675cae77e6cca30c6d56b3ac919ae2c43f7c4","original_commit_id":"88e9c0e606feb194b112e82baefd639287f544bc","user":{"login":"aleksandrhristov","id":15632581,"avatar_url":"https://avatars.githubusercontent.com/u/15632581?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksandrhristov","html_url":"https://github.com/aleksandrhristov","followers_url":"https://api.github.com/users/aleksandrhristov/followers","following_url":"https://api.github.com/users/aleksandrhristov/following{/other_user}","gists_url":"https://api.github.com/users/aleksandrhristov/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksandrhristov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksandrhristov/subscriptions","organizations_url":"https://api.github.com/users/aleksandrhristov/orgs","repos_url":"https://api.github.com/users/aleksandrhristov/repos","events_url":"https://api.github.com/users/aleksandrhristov/events{/privacy}","received_events_url":"https://api.github.com/users/aleksandrhristov/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2016-06-09T13:26:20Z","updated_at":"2016-06-09T13:26:20Z","html_url":"https://github.com/clouway-incubator/collections/pull/7#discussion_r66439287","pull_request_url":"https://api.github.com/repos/clouway-incubator/collections/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/collections/pulls/comments/66439287"},"html":{"href":"https://github.com/clouway-incubator/collections/pull/7#discussion_r66439287"},"pull_request":{"href":"https://api.github.com/repos/clouway-incubator/collections/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/clouway-incubator/collections/pulls/7","id":73195091,"html_url":"https://github.com/clouway-incubator/collections/pull/7","diff_url":"https://github.com/clouway-incubator/collections/pull/7.diff","patch_url":"https://github.com/clouway-incubator/collections/pull/7.patch","issue_url":"https://api.github.com/repos/clouway-incubator/collections/issues/7","number":7,"state":"open","locked":false,"title":"Alexander hristov","user":{"login":"aleksandrhristov","id":15632581,"avatar_url":"https://avatars.githubusercontent.com/u/15632581?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksandrhristov","html_url":"https://github.com/aleksandrhristov","followers_url":"https://api.github.com/users/aleksandrhristov/followers","following_url":"https://api.github.com/users/aleksandrhristov/following{/other_user}","gists_url":"https://api.github.com/users/aleksandrhristov/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksandrhristov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksandrhristov/subscriptions","organizations_url":"https://api.github.com/users/aleksandrhristov/orgs","repos_url":"https://api.github.com/users/aleksandrhristov/repos","events_url":"https://api.github.com/users/aleksandrhristov/events{/privacy}","received_events_url":"https://api.github.com/users/aleksandrhristov/received_events","type":"User","site_admin":false},"body":"first and second task from Collections","created_at":"2016-06-09T11:06:10Z","updated_at":"2016-06-09T13:26:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80ca5e4ec20b349f1997102f7c122285f5a429e3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/clouway-incubator/collections/pulls/7/commits","review_comments_url":"https://api.github.com/repos/clouway-incubator/collections/pulls/7/comments","review_comment_url":"https://api.github.com/repos/clouway-incubator/collections/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clouway-incubator/collections/issues/7/comments","statuses_url":"https://api.github.com/repos/clouway-incubator/collections/statuses/bda675cae77e6cca30c6d56b3ac919ae2c43f7c4","head":{"label":"aleksandrhristov:alexander_hristov","ref":"alexander_hristov","sha":"bda675cae77e6cca30c6d56b3ac919ae2c43f7c4","user":{"login":"aleksandrhristov","id":15632581,"avatar_url":"https://avatars.githubusercontent.com/u/15632581?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksandrhristov","html_url":"https://github.com/aleksandrhristov","followers_url":"https://api.github.com/users/aleksandrhristov/followers","following_url":"https://api.github.com/users/aleksandrhristov/following{/other_user}","gists_url":"https://api.github.com/users/aleksandrhristov/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksandrhristov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksandrhristov/subscriptions","organizations_url":"https://api.github.com/users/aleksandrhristov/orgs","repos_url":"https://api.github.com/users/aleksandrhristov/repos","events_url":"https://api.github.com/users/aleksandrhristov/events{/privacy}","received_events_url":"https://api.github.com/users/aleksandrhristov/received_events","type":"User","site_admin":false},"repo":{"id":60093433,"name":"collections","full_name":"aleksandrhristov/collections","owner":{"login":"aleksandrhristov","id":15632581,"avatar_url":"https://avatars.githubusercontent.com/u/15632581?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksandrhristov","html_url":"https://github.com/aleksandrhristov","followers_url":"https://api.github.com/users/aleksandrhristov/followers","following_url":"https://api.github.com/users/aleksandrhristov/following{/other_user}","gists_url":"https://api.github.com/users/aleksandrhristov/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksandrhristov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksandrhristov/subscriptions","organizations_url":"https://api.github.com/users/aleksandrhristov/orgs","repos_url":"https://api.github.com/users/aleksandrhristov/repos","events_url":"https://api.github.com/users/aleksandrhristov/events{/privacy}","received_events_url":"https://api.github.com/users/aleksandrhristov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aleksandrhristov/collections","description":"Collections","fork":true,"url":"https://api.github.com/repos/aleksandrhristov/collections","forks_url":"https://api.github.com/repos/aleksandrhristov/collections/forks","keys_url":"https://api.github.com/repos/aleksandrhristov/collections/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aleksandrhristov/collections/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aleksandrhristov/collections/teams","hooks_url":"https://api.github.com/repos/aleksandrhristov/collections/hooks","issue_events_url":"https://api.github.com/repos/aleksandrhristov/collections/issues/events{/number}","events_url":"https://api.github.com/repos/aleksandrhristov/collections/events","assignees_url":"https://api.github.com/repos/aleksandrhristov/collections/assignees{/user}","branches_url":"https://api.github.com/repos/aleksandrhristov/collections/branches{/branch}","tags_url":"https://api.github.com/repos/aleksandrhristov/collections/tags","blobs_url":"https://api.github.com/repos/aleksandrhristov/collections/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aleksandrhristov/collections/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aleksandrhristov/collections/git/refs{/sha}","trees_url":"https://api.github.com/repos/aleksandrhristov/collections/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aleksandrhristov/collections/statuses/{sha}","languages_url":"https://api.github.com/repos/aleksandrhristov/collections/languages","stargazers_url":"https://api.github.com/repos/aleksandrhristov/collections/stargazers","contributors_url":"https://api.github.com/repos/aleksandrhristov/collections/contributors","subscribers_url":"https://api.github.com/repos/aleksandrhristov/collections/subscribers","subscription_url":"https://api.github.com/repos/aleksandrhristov/collections/subscription","commits_url":"https://api.github.com/repos/aleksandrhristov/collections/commits{/sha}","git_commits_url":"https://api.github.com/repos/aleksandrhristov/collections/git/commits{/sha}","comments_url":"https://api.github.com/repos/aleksandrhristov/collections/comments{/number}","issue_comment_url":"https://api.github.com/repos/aleksandrhristov/collections/issues/comments{/number}","contents_url":"https://api.github.com/repos/aleksandrhristov/collections/contents/{+path}","compare_url":"https://api.github.com/repos/aleksandrhristov/collections/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aleksandrhristov/collections/merges","archive_url":"https://api.github.com/repos/aleksandrhristov/collections/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aleksandrhristov/collections/downloads","issues_url":"https://api.github.com/repos/aleksandrhristov/collections/issues{/number}","pulls_url":"https://api.github.com/repos/aleksandrhristov/collections/pulls{/number}","milestones_url":"https://api.github.com/repos/aleksandrhristov/collections/milestones{/number}","notifications_url":"https://api.github.com/repos/aleksandrhristov/collections/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aleksandrhristov/collections/labels{/name}","releases_url":"https://api.github.com/repos/aleksandrhristov/collections/releases{/id}","deployments_url":"https://api.github.com/repos/aleksandrhristov/collections/deployments","created_at":"2016-05-31T13:47:57Z","updated_at":"2016-04-13T13:25:02Z","pushed_at":"2016-06-09T13:26:14Z","git_url":"git://github.com/aleksandrhristov/collections.git","ssh_url":"git@github.com:aleksandrhristov/collections.git","clone_url":"https://github.com/aleksandrhristov/collections.git","svn_url":"https://github.com/aleksandrhristov/collections","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":null,"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":"clouway-incubator:alexander_hristov","ref":"alexander_hristov","sha":"b11c613b8fecf71f3406e4d8439e7cbd52ea30f9","user":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":56153912,"name":"collections","full_name":"clouway-incubator/collections","owner":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clouway-incubator/collections","description":"Collections","fork":false,"url":"https://api.github.com/repos/clouway-incubator/collections","forks_url":"https://api.github.com/repos/clouway-incubator/collections/forks","keys_url":"https://api.github.com/repos/clouway-incubator/collections/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clouway-incubator/collections/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clouway-incubator/collections/teams","hooks_url":"https://api.github.com/repos/clouway-incubator/collections/hooks","issue_events_url":"https://api.github.com/repos/clouway-incubator/collections/issues/events{/number}","events_url":"https://api.github.com/repos/clouway-incubator/collections/events","assignees_url":"https://api.github.com/repos/clouway-incubator/collections/assignees{/user}","branches_url":"https://api.github.com/repos/clouway-incubator/collections/branches{/branch}","tags_url":"https://api.github.com/repos/clouway-incubator/collections/tags","blobs_url":"https://api.github.com/repos/clouway-incubator/collections/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clouway-incubator/collections/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clouway-incubator/collections/git/refs{/sha}","trees_url":"https://api.github.com/repos/clouway-incubator/collections/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clouway-incubator/collections/statuses/{sha}","languages_url":"https://api.github.com/repos/clouway-incubator/collections/languages","stargazers_url":"https://api.github.com/repos/clouway-incubator/collections/stargazers","contributors_url":"https://api.github.com/repos/clouway-incubator/collections/contributors","subscribers_url":"https://api.github.com/repos/clouway-incubator/collections/subscribers","subscription_url":"https://api.github.com/repos/clouway-incubator/collections/subscription","commits_url":"https://api.github.com/repos/clouway-incubator/collections/commits{/sha}","git_commits_url":"https://api.github.com/repos/clouway-incubator/collections/git/commits{/sha}","comments_url":"https://api.github.com/repos/clouway-incubator/collections/comments{/number}","issue_comment_url":"https://api.github.com/repos/clouway-incubator/collections/issues/comments{/number}","contents_url":"https://api.github.com/repos/clouway-incubator/collections/contents/{+path}","compare_url":"https://api.github.com/repos/clouway-incubator/collections/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clouway-incubator/collections/merges","archive_url":"https://api.github.com/repos/clouway-incubator/collections/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clouway-incubator/collections/downloads","issues_url":"https://api.github.com/repos/clouway-incubator/collections/issues{/number}","pulls_url":"https://api.github.com/repos/clouway-incubator/collections/pulls{/number}","milestones_url":"https://api.github.com/repos/clouway-incubator/collections/milestones{/number}","notifications_url":"https://api.github.com/repos/clouway-incubator/collections/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clouway-incubator/collections/labels{/name}","releases_url":"https://api.github.com/repos/clouway-incubator/collections/releases{/id}","deployments_url":"https://api.github.com/repos/clouway-incubator/collections/deployments","created_at":"2016-04-13T13:25:02Z","updated_at":"2016-04-13T13:25:02Z","pushed_at":"2016-06-09T13:26:14Z","git_url":"git://github.com/clouway-incubator/collections.git","ssh_url":"git@github.com:clouway-incubator/collections.git","clone_url":"https://github.com/clouway-incubator/collections.git","svn_url":"https://github.com/clouway-incubator/collections","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/collections/pulls/7"},"html":{"href":"https://github.com/clouway-incubator/collections/pull/7"},"issue":{"href":"https://api.github.com/repos/clouway-incubator/collections/issues/7"},"comments":{"href":"https://api.github.com/repos/clouway-incubator/collections/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/clouway-incubator/collections/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/clouway-incubator/collections/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clouway-incubator/collections/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/clouway-incubator/collections/statuses/bda675cae77e6cca30c6d56b3ac919ae2c43f7c4"}}}}
{"actor":{"display_login":"aleksandrhristov"}}