{"action":"created","comment":{"url":"https://api.github.com/repos/bluebery/hs-interview/pulls/comments/84780408","pull_request_review_id":5536462,"id":84780408,"diff_hunk":"@@ -0,0 +1,103 @@\n+package com.circle.profile.ProfileActivity;\n+import com.hootsuite.manager.Manager;\n+import com.circle.somelibrary.*;\n+import java.util.LinkedList;\n+import java.util.List;\n+import javax.inject.Inject;\n+import butterknife.InjectView;\n+import kotlin.Pair;\n+\n+public final class ProfileListFragment extends Fragment implements SomeInterface {\n+    \n+    @Inject\n+    private ManagerImpl manager;\n+    private TextView mCountText;  \n+  \n+    protected LinkedList<SocialProfile> socialProfileList = new LinkedList<SocialProfile>();\n+    Activity mParentActivity;\n+    \n+    @Override\n+    public void onAttach(Activity activity) {\n+        super.onAttach(activity);\n+        mParentActivity = activity;\n+    }\n+    \n+    public void onCreate(Bundle savedInstanceState) {\n+        super.onCreate(savedInstanceState);\n+        socialProfileList.add(getIntent().getExtras().getParcelable(\"profileList\"));\n+    }\n+\n+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n+        super.onCreateView(inflater, container, savedInstanceState)\n+        View view = inflater.inflate(R.id.profile_screen, container, false);\n+        return view;\n+    }\n+    \n+    public void onStart() {\n+        mCountText = (TextView) findViewById(R.id.text_count);\n+        RecyclerView recyclingView = (RecyclerView) findViewById(R.id.recycler_view);\n+        \n+        mCountText.setText(\"Count of Profiles \" + socialProfiles.size());\n+        recyclingView.setAdapter(new SocialProfilesAdapter(socialProfileList));\n+        recyclingView.setLayoutManager(new LinearLayoutManager());\n+    }\n+        \n+    /**\n+     * Finds and returns the profiles in this fragment that is similar to the similarTo parameter.\n+     * @param similarTo A collection of profiles to be similar to\n+     */\n+    public LinkedList<SocialProfile> similar(ArrayList<SocialProfile> similarTo) {\n+        for (int i = 0; i < socialProfileList.size() - 1; i++) {\n+            SocialProfile currentProfile = socialProfileList.get(i);\n+            for (int j = 0; j < similarTo.size() - 1; j++) {\n+                SocialProfile similarProfile = similarTo.get(j);\n+                if (compareInterests(currentProfile, similarProfile) == 0) {\n+                    socialProfileList.remove(i)\n+                }\n+            }\n+        }\n+        return socialProfileList;\n+    }\n+\n+    public int compareInterests(SocialProfile s1, SocialProfile s2) {\n+        int count = 0;\n+        for (Pair<Integer, Interests> interestRank : s1.interestsRank) {\n+            for(Pair<Integer, Interests> interestRank2 : s2.interestsRank) {\n+                if (interestRank2.getSecond() == interestRank.getSecond()) {\n+                    if (interestRank.getFirst() != interestRank.getFirst()) {\n+                        count++;\n+                    }\n+                }\n+            }\n+        }\n+        return count;\n+    }\n+    \n+    class SocialProfile implements Parcelable {\n+        // Parcelable Implementation Omitted\n+        // A List of Interests and their rank\n+        // Example: [{1, \"MUSIC\"}, {2, \"FOOD\"}, ... ]\n+        public List<Pair<Integer, Interests>> interestsRank;\n+    }\n+\n+    private enum Interests {\n+        MUSIC,\n+        SPORTS,\n+        SCIENCE,\n+        MOVIES,\n+        FOOD\n+    }\n+ \n+    public boolean onCreateOptionsMenu(Menu menu) {\n+        super.onCreateOptionsMenu(menu)\n+    }\n+\n+    @Override\n+    public boolean onOptionsItemSelected(MenuItem item) {\n+        switch (item.getItemId()) {\n+            case R.id.menu_compare:","path":"ProfileActivity.java","position":98,"original_position":98,"commit_id":"30249fac9aa909a44e7be7af50f56cdfe01ead91","original_commit_id":"30249fac9aa909a44e7be7af50f56cdfe01ead91","user":{"login":"bluebery","id":7797980,"avatar_url":"https://avatars.githubusercontent.com/u/7797980?v=3","gravatar_id":"","url":"https://api.github.com/users/bluebery","html_url":"https://github.com/bluebery","followers_url":"https://api.github.com/users/bluebery/followers","following_url":"https://api.github.com/users/bluebery/following{/other_user}","gists_url":"https://api.github.com/users/bluebery/gists{/gist_id}","starred_url":"https://api.github.com/users/bluebery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluebery/subscriptions","organizations_url":"https://api.github.com/users/bluebery/orgs","repos_url":"https://api.github.com/users/bluebery/repos","events_url":"https://api.github.com/users/bluebery/events{/privacy}","received_events_url":"https://api.github.com/users/bluebery/received_events","type":"User","site_admin":false},"body":"Please add default:","created_at":"2016-10-24T20:50:14Z","updated_at":"2016-10-24T20:50:14Z","html_url":"https://github.com/bluebery/hs-interview/pull/1#discussion_r84780408","pull_request_url":"https://api.github.com/repos/bluebery/hs-interview/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/bluebery/hs-interview/pulls/comments/84780408"},"html":{"href":"https://github.com/bluebery/hs-interview/pull/1#discussion_r84780408"},"pull_request":{"href":"https://api.github.com/repos/bluebery/hs-interview/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/bluebery/hs-interview/pulls/1","id":89081963,"html_url":"https://github.com/bluebery/hs-interview/pull/1","diff_url":"https://github.com/bluebery/hs-interview/pull/1.diff","patch_url":"https://github.com/bluebery/hs-interview/pull/1.patch","issue_url":"https://api.github.com/repos/bluebery/hs-interview/issues/1","number":1,"state":"open","locked":false,"title":"profile activity for code review interview question","user":{"login":"wesley-alcock-hs","id":14061948,"avatar_url":"https://avatars.githubusercontent.com/u/14061948?v=3","gravatar_id":"","url":"https://api.github.com/users/wesley-alcock-hs","html_url":"https://github.com/wesley-alcock-hs","followers_url":"https://api.github.com/users/wesley-alcock-hs/followers","following_url":"https://api.github.com/users/wesley-alcock-hs/following{/other_user}","gists_url":"https://api.github.com/users/wesley-alcock-hs/gists{/gist_id}","starred_url":"https://api.github.com/users/wesley-alcock-hs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesley-alcock-hs/subscriptions","organizations_url":"https://api.github.com/users/wesley-alcock-hs/orgs","repos_url":"https://api.github.com/users/wesley-alcock-hs/repos","events_url":"https://api.github.com/users/wesley-alcock-hs/events{/privacy}","received_events_url":"https://api.github.com/users/wesley-alcock-hs/received_events","type":"User","site_admin":false},"body":"Take a look at my code!! Let me know what you think. Thanks!","created_at":"2016-10-12T19:52:46Z","updated_at":"2016-10-24T20:50:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c005d79a2f02b5d23792dbe7dc2a9fb8601ed32","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bluebery/hs-interview/pulls/1/commits","review_comments_url":"https://api.github.com/repos/bluebery/hs-interview/pulls/1/comments","review_comment_url":"https://api.github.com/repos/bluebery/hs-interview/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bluebery/hs-interview/issues/1/comments","statuses_url":"https://api.github.com/repos/bluebery/hs-interview/statuses/30249fac9aa909a44e7be7af50f56cdfe01ead91","head":{"label":"bluebery:CRExample","ref":"CRExample","sha":"30249fac9aa909a44e7be7af50f56cdfe01ead91","user":{"login":"bluebery","id":7797980,"avatar_url":"https://avatars.githubusercontent.com/u/7797980?v=3","gravatar_id":"","url":"https://api.github.com/users/bluebery","html_url":"https://github.com/bluebery","followers_url":"https://api.github.com/users/bluebery/followers","following_url":"https://api.github.com/users/bluebery/following{/other_user}","gists_url":"https://api.github.com/users/bluebery/gists{/gist_id}","starred_url":"https://api.github.com/users/bluebery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluebery/subscriptions","organizations_url":"https://api.github.com/users/bluebery/orgs","repos_url":"https://api.github.com/users/bluebery/repos","events_url":"https://api.github.com/users/bluebery/events{/privacy}","received_events_url":"https://api.github.com/users/bluebery/received_events","type":"User","site_admin":false},"repo":{"id":70735579,"name":"hs-interview","full_name":"bluebery/hs-interview","owner":{"login":"bluebery","id":7797980,"avatar_url":"https://avatars.githubusercontent.com/u/7797980?v=3","gravatar_id":"","url":"https://api.github.com/users/bluebery","html_url":"https://github.com/bluebery","followers_url":"https://api.github.com/users/bluebery/followers","following_url":"https://api.github.com/users/bluebery/following{/other_user}","gists_url":"https://api.github.com/users/bluebery/gists{/gist_id}","starred_url":"https://api.github.com/users/bluebery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluebery/subscriptions","organizations_url":"https://api.github.com/users/bluebery/orgs","repos_url":"https://api.github.com/users/bluebery/repos","events_url":"https://api.github.com/users/bluebery/events{/privacy}","received_events_url":"https://api.github.com/users/bluebery/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bluebery/hs-interview","description":null,"fork":false,"url":"https://api.github.com/repos/bluebery/hs-interview","forks_url":"https://api.github.com/repos/bluebery/hs-interview/forks","keys_url":"https://api.github.com/repos/bluebery/hs-interview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bluebery/hs-interview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bluebery/hs-interview/teams","hooks_url":"https://api.github.com/repos/bluebery/hs-interview/hooks","issue_events_url":"https://api.github.com/repos/bluebery/hs-interview/issues/events{/number}","events_url":"https://api.github.com/repos/bluebery/hs-interview/events","assignees_url":"https://api.github.com/repos/bluebery/hs-interview/assignees{/user}","branches_url":"https://api.github.com/repos/bluebery/hs-interview/branches{/branch}","tags_url":"https://api.github.com/repos/bluebery/hs-interview/tags","blobs_url":"https://api.github.com/repos/bluebery/hs-interview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bluebery/hs-interview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bluebery/hs-interview/git/refs{/sha}","trees_url":"https://api.github.com/repos/bluebery/hs-interview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bluebery/hs-interview/statuses/{sha}","languages_url":"https://api.github.com/repos/bluebery/hs-interview/languages","stargazers_url":"https://api.github.com/repos/bluebery/hs-interview/stargazers","contributors_url":"https://api.github.com/repos/bluebery/hs-interview/contributors","subscribers_url":"https://api.github.com/repos/bluebery/hs-interview/subscribers","subscription_url":"https://api.github.com/repos/bluebery/hs-interview/subscription","commits_url":"https://api.github.com/repos/bluebery/hs-interview/commits{/sha}","git_commits_url":"https://api.github.com/repos/bluebery/hs-interview/git/commits{/sha}","comments_url":"https://api.github.com/repos/bluebery/hs-interview/comments{/number}","issue_comment_url":"https://api.github.com/repos/bluebery/hs-interview/issues/comments{/number}","contents_url":"https://api.github.com/repos/bluebery/hs-interview/contents/{+path}","compare_url":"https://api.github.com/repos/bluebery/hs-interview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bluebery/hs-interview/merges","archive_url":"https://api.github.com/repos/bluebery/hs-interview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bluebery/hs-interview/downloads","issues_url":"https://api.github.com/repos/bluebery/hs-interview/issues{/number}","pulls_url":"https://api.github.com/repos/bluebery/hs-interview/pulls{/number}","milestones_url":"https://api.github.com/repos/bluebery/hs-interview/milestones{/number}","notifications_url":"https://api.github.com/repos/bluebery/hs-interview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bluebery/hs-interview/labels{/name}","releases_url":"https://api.github.com/repos/bluebery/hs-interview/releases{/id}","deployments_url":"https://api.github.com/repos/bluebery/hs-interview/deployments","created_at":"2016-10-12T19:46:33Z","updated_at":"2016-10-12T19:46:33Z","pushed_at":"2016-10-12T19:52:46Z","git_url":"git://github.com/bluebery/hs-interview.git","ssh_url":"git@github.com:bluebery/hs-interview.git","clone_url":"https://github.com/bluebery/hs-interview.git","svn_url":"https://github.com/bluebery/hs-interview","homepage":null,"size":2,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"bluebery:master","ref":"master","sha":"e49be3cc0bff31ac2dfe567f574897683320cb77","user":{"login":"bluebery","id":7797980,"avatar_url":"https://avatars.githubusercontent.com/u/7797980?v=3","gravatar_id":"","url":"https://api.github.com/users/bluebery","html_url":"https://github.com/bluebery","followers_url":"https://api.github.com/users/bluebery/followers","following_url":"https://api.github.com/users/bluebery/following{/other_user}","gists_url":"https://api.github.com/users/bluebery/gists{/gist_id}","starred_url":"https://api.github.com/users/bluebery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluebery/subscriptions","organizations_url":"https://api.github.com/users/bluebery/orgs","repos_url":"https://api.github.com/users/bluebery/repos","events_url":"https://api.github.com/users/bluebery/events{/privacy}","received_events_url":"https://api.github.com/users/bluebery/received_events","type":"User","site_admin":false},"repo":{"id":70735579,"name":"hs-interview","full_name":"bluebery/hs-interview","owner":{"login":"bluebery","id":7797980,"avatar_url":"https://avatars.githubusercontent.com/u/7797980?v=3","gravatar_id":"","url":"https://api.github.com/users/bluebery","html_url":"https://github.com/bluebery","followers_url":"https://api.github.com/users/bluebery/followers","following_url":"https://api.github.com/users/bluebery/following{/other_user}","gists_url":"https://api.github.com/users/bluebery/gists{/gist_id}","starred_url":"https://api.github.com/users/bluebery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluebery/subscriptions","organizations_url":"https://api.github.com/users/bluebery/orgs","repos_url":"https://api.github.com/users/bluebery/repos","events_url":"https://api.github.com/users/bluebery/events{/privacy}","received_events_url":"https://api.github.com/users/bluebery/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bluebery/hs-interview","description":null,"fork":false,"url":"https://api.github.com/repos/bluebery/hs-interview","forks_url":"https://api.github.com/repos/bluebery/hs-interview/forks","keys_url":"https://api.github.com/repos/bluebery/hs-interview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bluebery/hs-interview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bluebery/hs-interview/teams","hooks_url":"https://api.github.com/repos/bluebery/hs-interview/hooks","issue_events_url":"https://api.github.com/repos/bluebery/hs-interview/issues/events{/number}","events_url":"https://api.github.com/repos/bluebery/hs-interview/events","assignees_url":"https://api.github.com/repos/bluebery/hs-interview/assignees{/user}","branches_url":"https://api.github.com/repos/bluebery/hs-interview/branches{/branch}","tags_url":"https://api.github.com/repos/bluebery/hs-interview/tags","blobs_url":"https://api.github.com/repos/bluebery/hs-interview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bluebery/hs-interview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bluebery/hs-interview/git/refs{/sha}","trees_url":"https://api.github.com/repos/bluebery/hs-interview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bluebery/hs-interview/statuses/{sha}","languages_url":"https://api.github.com/repos/bluebery/hs-interview/languages","stargazers_url":"https://api.github.com/repos/bluebery/hs-interview/stargazers","contributors_url":"https://api.github.com/repos/bluebery/hs-interview/contributors","subscribers_url":"https://api.github.com/repos/bluebery/hs-interview/subscribers","subscription_url":"https://api.github.com/repos/bluebery/hs-interview/subscription","commits_url":"https://api.github.com/repos/bluebery/hs-interview/commits{/sha}","git_commits_url":"https://api.github.com/repos/bluebery/hs-interview/git/commits{/sha}","comments_url":"https://api.github.com/repos/bluebery/hs-interview/comments{/number}","issue_comment_url":"https://api.github.com/repos/bluebery/hs-interview/issues/comments{/number}","contents_url":"https://api.github.com/repos/bluebery/hs-interview/contents/{+path}","compare_url":"https://api.github.com/repos/bluebery/hs-interview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bluebery/hs-interview/merges","archive_url":"https://api.github.com/repos/bluebery/hs-interview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bluebery/hs-interview/downloads","issues_url":"https://api.github.com/repos/bluebery/hs-interview/issues{/number}","pulls_url":"https://api.github.com/repos/bluebery/hs-interview/pulls{/number}","milestones_url":"https://api.github.com/repos/bluebery/hs-interview/milestones{/number}","notifications_url":"https://api.github.com/repos/bluebery/hs-interview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bluebery/hs-interview/labels{/name}","releases_url":"https://api.github.com/repos/bluebery/hs-interview/releases{/id}","deployments_url":"https://api.github.com/repos/bluebery/hs-interview/deployments","created_at":"2016-10-12T19:46:33Z","updated_at":"2016-10-12T19:46:33Z","pushed_at":"2016-10-12T19:52:46Z","git_url":"git://github.com/bluebery/hs-interview.git","ssh_url":"git@github.com:bluebery/hs-interview.git","clone_url":"https://github.com/bluebery/hs-interview.git","svn_url":"https://github.com/bluebery/hs-interview","homepage":null,"size":2,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bluebery/hs-interview/pulls/1"},"html":{"href":"https://github.com/bluebery/hs-interview/pull/1"},"issue":{"href":"https://api.github.com/repos/bluebery/hs-interview/issues/1"},"comments":{"href":"https://api.github.com/repos/bluebery/hs-interview/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/bluebery/hs-interview/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/bluebery/hs-interview/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bluebery/hs-interview/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/bluebery/hs-interview/statuses/30249fac9aa909a44e7be7af50f56cdfe01ead91"}}}}
{"actor":{"display_login":"bluebery"}}