{"action":"created","comment":{"url":"https://api.github.com/repos/Genius/groupie/pulls/comments/91147899","pull_request_review_id":11657588,"id":91147899,"diff_hunk":"@@ -153,4 +147,254 @@ public void settingNullHeaderThrowsNullPointerException(){\n \n         verify(item).setGroupDataObserver(section);\n     }\n+\n+    @Test\n+    public void setPlaceholderOnEmptySectionAddsPlaceholder() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setPlaceholder(placeholder);\n+\n+        verify(groupAdapter).onItemRangeInserted(section, headerSize, placeholderSize);\n+    }\n+\n+    @Test\n+    public void getGroupReturnsPlaceholder() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.setPlaceholder(placeholder);\n+\n+        assertEquals(placeholder, section.getGroup(1));\n+    }\n+\n+    @Test\n+    public void setPlaceholderOnNonEmptySectionDoesNotAddPlaceholder() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.add(new DummyItem());\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setPlaceholder(placeholder);\n+\n+        verify(groupAdapter, never()).onItemRangeInserted(any(Section.class), anyInt(), anyInt());\n+    }\n+\n+    @Test\n+    public void placeholderIsIncludedInItemCountIfBodyIsEmpty() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.setPlaceholder(placeholder);\n+\n+        assertEquals(headerSize + placeholderSize + footerSize, section.getItemCount());\n+    }\n+\n+    @Test\n+    public void placeholderIsNotIncludedInItemCountIfBodyHasContent() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.setPlaceholder(placeholder);\n+        section.add(new DummyItem());\n+\n+        assertEquals(headerSize + footerSize + 1, section.getItemCount());\n+    }\n+\n+    @Test\n+    public void addEmptyBodyContentDoesNotRemovePlaceholder() {\n+        Section section = new Section();\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setPlaceholder(placeholder);\n+        section.add(emptyGroup);\n+\n+        verify(groupAdapter, never()).onItemRangeRemoved(any(Section.class), anyInt(), anyInt());\n+    }\n+\n+    @Test\n+    public void addBodyContentRemovesPlaceholder() {\n+        Section section = new Section();\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setPlaceholder(placeholder);\n+        section.add(new DummyItem());\n+\n+        verify(groupAdapter).onItemRangeRemoved(section, 0, placeholderSize);\n+    }\n+\n+    @Test\n+    public void removeAllBodyContentAddsPlaceholder() {\n+        Section section = new Section();\n+        section.setPlaceholder(placeholder);\n+        Item item = new DummyItem();\n+        section.add(item);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.remove(item);\n+\n+        verify(groupAdapter).onItemRangeInserted(section, 0, placeholderSize);\n+    }\n+\n+    @Test\n+    public void removeAllBodyContentByModifyingAChildGroupAddsPlaceholder() {\n+        Section section = new Section();\n+        section.setPlaceholder(placeholder);\n+        Section childGroup = new Section();\n+        Item childItem = new DummyItem();\n+        childGroup.add(childItem);\n+        section.add(childGroup);\n+        section.setGroupDataObserver(groupAdapter);\n+        childGroup.remove(childItem);\n+\n+        verify(groupAdapter).onItemRangeInserted(section, 0, placeholderSize);\n+    }\n+\n+    @Test\n+    public void removePlaceholderNotifies() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.setPlaceholder(placeholder);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.removePlaceholder();\n+\n+        verify(groupAdapter).onItemRangeRemoved(section, headerSize, placeholderSize);\n+    }\n+\n+    @Test\n+    public void setHideWhenEmptyRemovesAnExistingPlaceholder() {\n+        Section section = new Section();\n+        section.setPlaceholder(placeholder);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setHideWhenEmpty(true);\n+\n+        verify(groupAdapter).onItemRangeRemoved(section, 0, placeholderSize);\n+    }\n+\n+    @Test\n+    public void setHeaderAddsHeader() {\n+        Section section = new Section();\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setHeader(header);\n+\n+        verify(groupAdapter).onItemRangeInserted(section, 0, headerSize);\n+    }\n+\n+    @Test\n+    public void removeHeaderRemovesHeader() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.removeHeader();\n+\n+        verify(groupAdapter).onItemRangeRemoved(section, 0, headerSize);\n+    }\n+\n+    @Test\n+    public void setFooterAddsFooter() {\n+        Section section = new Section();\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setFooter(footer);\n+\n+        verify(groupAdapter).onItemRangeInserted(section, 0, footerSize);\n+    }\n+\n+    @Test\n+    public void removeFooterRemovesFooter() {\n+        Section section = new Section();\n+        section.setFooter(footer);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.removeFooter();\n+\n+        verify(groupAdapter).onItemRangeRemoved(section, 0, footerSize);\n+    }\n+\n+    @Test\n+    public void setHideWhenEmptyRemovesExistingHeaderAndFooter() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setHideWhenEmpty(true);\n+\n+        verify(groupAdapter).onItemRangeRemoved(section, 0, headerSize + footerSize);\n+    }\n+\n+    @Test\n+    public void setHideWhenEmptyRemovesExistingHeaderFooterAndPlaceholder() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.setPlaceholder(placeholder);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setHideWhenEmpty(true);\n+\n+        verify(groupAdapter).onItemRangeRemoved(section, 0, headerSize + footerSize + placeholderSize);\n+    }\n+\n+    @Test\n+    public void setHideWhenEmptyFalseAddsExistingHeaderAndFooter() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setFooter(footer);\n+        section.setHideWhenEmpty(true);\n+        section.setGroupDataObserver(groupAdapter);\n+        section.setHideWhenEmpty(false);\n+\n+        verify(groupAdapter).onItemRangeInserted(section, 0, headerSize);\n+        verify(groupAdapter).onItemRangeInserted(section, headerSize, footerSize);\n+    }\n+\n+    @Test\n+    public void itemCountIsZeroWhenSetHideWhenEmptyTrue() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setPlaceholder(placeholder);\n+        section.setFooter(footer);\n+        section.setHideWhenEmpty(true);\n+\n+        assertEquals(0, section.getItemCount());\n+    }\n+\n+    @Test\n+    public void groupCountIsHeaderFooterAndChildrenWhenNonEmpty() {\n+        Section section = new Section();\n+        section.setHeader(header);\n+        section.setPlaceholder(placeholder);\n+        section.setFooter(footer);\n+        section.add(new DummyItem());\n+","path":"groupie/src/test/java/com/genius/groupie/SectionTest.java","position":292,"original_position":292,"commit_id":"db969e3264d7cfa8d52929d24d8b81424ae2bc9b","original_commit_id":"db969e3264d7cfa8d52929d24d8b81424ae2bc9b","user":{"login":"lisawray","id":1466033,"avatar_url":"https://avatars.githubusercontent.com/u/1466033?v=3","gravatar_id":"","url":"https://api.github.com/users/lisawray","html_url":"https://github.com/lisawray","followers_url":"https://api.github.com/users/lisawray/followers","following_url":"https://api.github.com/users/lisawray/following{/other_user}","gists_url":"https://api.github.com/users/lisawray/gists{/gist_id}","starred_url":"https://api.github.com/users/lisawray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisawray/subscriptions","organizations_url":"https://api.github.com/users/lisawray/orgs","repos_url":"https://api.github.com/users/lisawray/repos","events_url":"https://api.github.com/users/lisawray/events{/privacy}","received_events_url":"https://api.github.com/users/lisawray/received_events","type":"User","site_admin":false},"body":"add another child","created_at":"2016-12-06T19:04:04Z","updated_at":"2016-12-06T19:04:04Z","html_url":"https://github.com/Genius/groupie/pull/44#discussion_r91147899","pull_request_url":"https://api.github.com/repos/Genius/groupie/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/Genius/groupie/pulls/comments/91147899"},"html":{"href":"https://github.com/Genius/groupie/pull/44#discussion_r91147899"},"pull_request":{"href":"https://api.github.com/repos/Genius/groupie/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/Genius/groupie/pulls/44","id":96779619,"html_url":"https://github.com/Genius/groupie/pull/44","diff_url":"https://github.com/Genius/groupie/pull/44.diff","patch_url":"https://github.com/Genius/groupie/pull/44.patch","issue_url":"https://api.github.com/repos/Genius/groupie/issues/44","number":44,"state":"open","locked":false,"title":"Section placeholder","user":{"login":"lisawray","id":1466033,"avatar_url":"https://avatars.githubusercontent.com/u/1466033?v=3","gravatar_id":"","url":"https://api.github.com/users/lisawray","html_url":"https://github.com/lisawray","followers_url":"https://api.github.com/users/lisawray/followers","following_url":"https://api.github.com/users/lisawray/following{/other_user}","gists_url":"https://api.github.com/users/lisawray/gists{/gist_id}","starred_url":"https://api.github.com/users/lisawray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisawray/subscriptions","organizations_url":"https://api.github.com/users/lisawray/orgs","repos_url":"https://api.github.com/users/lisawray/repos","events_url":"https://api.github.com/users/lisawray/events{/privacy}","received_events_url":"https://api.github.com/users/lisawray/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-06T18:30:20Z","updated_at":"2016-12-06T19:04:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2da6349aa6b57f95e23f3ad25a88270d7425c9c8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Genius/groupie/pulls/44/commits","review_comments_url":"https://api.github.com/repos/Genius/groupie/pulls/44/comments","review_comment_url":"https://api.github.com/repos/Genius/groupie/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Genius/groupie/issues/44/comments","statuses_url":"https://api.github.com/repos/Genius/groupie/statuses/db969e3264d7cfa8d52929d24d8b81424ae2bc9b","head":{"label":"Genius:section-placeholder","ref":"section-placeholder","sha":"db969e3264d7cfa8d52929d24d8b81424ae2bc9b","user":{"login":"Genius","id":2738430,"avatar_url":"https://avatars.githubusercontent.com/u/2738430?v=3","gravatar_id":"","url":"https://api.github.com/users/Genius","html_url":"https://github.com/Genius","followers_url":"https://api.github.com/users/Genius/followers","following_url":"https://api.github.com/users/Genius/following{/other_user}","gists_url":"https://api.github.com/users/Genius/gists{/gist_id}","starred_url":"https://api.github.com/users/Genius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Genius/subscriptions","organizations_url":"https://api.github.com/users/Genius/orgs","repos_url":"https://api.github.com/users/Genius/repos","events_url":"https://api.github.com/users/Genius/events{/privacy}","received_events_url":"https://api.github.com/users/Genius/received_events","type":"Organization","site_admin":false},"repo":{"id":67165904,"name":"groupie","full_name":"Genius/groupie","owner":{"login":"Genius","id":2738430,"avatar_url":"https://avatars.githubusercontent.com/u/2738430?v=3","gravatar_id":"","url":"https://api.github.com/users/Genius","html_url":"https://github.com/Genius","followers_url":"https://api.github.com/users/Genius/followers","following_url":"https://api.github.com/users/Genius/following{/other_user}","gists_url":"https://api.github.com/users/Genius/gists{/gist_id}","starred_url":"https://api.github.com/users/Genius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Genius/subscriptions","organizations_url":"https://api.github.com/users/Genius/orgs","repos_url":"https://api.github.com/users/Genius/repos","events_url":"https://api.github.com/users/Genius/events{/privacy}","received_events_url":"https://api.github.com/users/Genius/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Genius/groupie","description":"Groupie helps you display and manage complex RecyclerView layouts.","fork":false,"url":"https://api.github.com/repos/Genius/groupie","forks_url":"https://api.github.com/repos/Genius/groupie/forks","keys_url":"https://api.github.com/repos/Genius/groupie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Genius/groupie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Genius/groupie/teams","hooks_url":"https://api.github.com/repos/Genius/groupie/hooks","issue_events_url":"https://api.github.com/repos/Genius/groupie/issues/events{/number}","events_url":"https://api.github.com/repos/Genius/groupie/events","assignees_url":"https://api.github.com/repos/Genius/groupie/assignees{/user}","branches_url":"https://api.github.com/repos/Genius/groupie/branches{/branch}","tags_url":"https://api.github.com/repos/Genius/groupie/tags","blobs_url":"https://api.github.com/repos/Genius/groupie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Genius/groupie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Genius/groupie/git/refs{/sha}","trees_url":"https://api.github.com/repos/Genius/groupie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Genius/groupie/statuses/{sha}","languages_url":"https://api.github.com/repos/Genius/groupie/languages","stargazers_url":"https://api.github.com/repos/Genius/groupie/stargazers","contributors_url":"https://api.github.com/repos/Genius/groupie/contributors","subscribers_url":"https://api.github.com/repos/Genius/groupie/subscribers","subscription_url":"https://api.github.com/repos/Genius/groupie/subscription","commits_url":"https://api.github.com/repos/Genius/groupie/commits{/sha}","git_commits_url":"https://api.github.com/repos/Genius/groupie/git/commits{/sha}","comments_url":"https://api.github.com/repos/Genius/groupie/comments{/number}","issue_comment_url":"https://api.github.com/repos/Genius/groupie/issues/comments{/number}","contents_url":"https://api.github.com/repos/Genius/groupie/contents/{+path}","compare_url":"https://api.github.com/repos/Genius/groupie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Genius/groupie/merges","archive_url":"https://api.github.com/repos/Genius/groupie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Genius/groupie/downloads","issues_url":"https://api.github.com/repos/Genius/groupie/issues{/number}","pulls_url":"https://api.github.com/repos/Genius/groupie/pulls{/number}","milestones_url":"https://api.github.com/repos/Genius/groupie/milestones{/number}","notifications_url":"https://api.github.com/repos/Genius/groupie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Genius/groupie/labels{/name}","releases_url":"https://api.github.com/repos/Genius/groupie/releases{/id}","deployments_url":"https://api.github.com/repos/Genius/groupie/deployments","created_at":"2016-09-01T20:59:35Z","updated_at":"2016-12-05T09:35:55Z","pushed_at":"2016-12-06T18:30:20Z","git_url":"git://github.com/Genius/groupie.git","ssh_url":"git@github.com:Genius/groupie.git","clone_url":"https://github.com/Genius/groupie.git","svn_url":"https://github.com/Genius/groupie","homepage":"","size":180,"stargazers_count":624,"watchers_count":624,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":13,"forks":46,"open_issues":13,"watchers":624,"default_branch":"master"}},"base":{"label":"Genius:master","ref":"master","sha":"5033b25da8b59e9d43b52346722db04ff936d7d7","user":{"login":"Genius","id":2738430,"avatar_url":"https://avatars.githubusercontent.com/u/2738430?v=3","gravatar_id":"","url":"https://api.github.com/users/Genius","html_url":"https://github.com/Genius","followers_url":"https://api.github.com/users/Genius/followers","following_url":"https://api.github.com/users/Genius/following{/other_user}","gists_url":"https://api.github.com/users/Genius/gists{/gist_id}","starred_url":"https://api.github.com/users/Genius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Genius/subscriptions","organizations_url":"https://api.github.com/users/Genius/orgs","repos_url":"https://api.github.com/users/Genius/repos","events_url":"https://api.github.com/users/Genius/events{/privacy}","received_events_url":"https://api.github.com/users/Genius/received_events","type":"Organization","site_admin":false},"repo":{"id":67165904,"name":"groupie","full_name":"Genius/groupie","owner":{"login":"Genius","id":2738430,"avatar_url":"https://avatars.githubusercontent.com/u/2738430?v=3","gravatar_id":"","url":"https://api.github.com/users/Genius","html_url":"https://github.com/Genius","followers_url":"https://api.github.com/users/Genius/followers","following_url":"https://api.github.com/users/Genius/following{/other_user}","gists_url":"https://api.github.com/users/Genius/gists{/gist_id}","starred_url":"https://api.github.com/users/Genius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Genius/subscriptions","organizations_url":"https://api.github.com/users/Genius/orgs","repos_url":"https://api.github.com/users/Genius/repos","events_url":"https://api.github.com/users/Genius/events{/privacy}","received_events_url":"https://api.github.com/users/Genius/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Genius/groupie","description":"Groupie helps you display and manage complex RecyclerView layouts.","fork":false,"url":"https://api.github.com/repos/Genius/groupie","forks_url":"https://api.github.com/repos/Genius/groupie/forks","keys_url":"https://api.github.com/repos/Genius/groupie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Genius/groupie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Genius/groupie/teams","hooks_url":"https://api.github.com/repos/Genius/groupie/hooks","issue_events_url":"https://api.github.com/repos/Genius/groupie/issues/events{/number}","events_url":"https://api.github.com/repos/Genius/groupie/events","assignees_url":"https://api.github.com/repos/Genius/groupie/assignees{/user}","branches_url":"https://api.github.com/repos/Genius/groupie/branches{/branch}","tags_url":"https://api.github.com/repos/Genius/groupie/tags","blobs_url":"https://api.github.com/repos/Genius/groupie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Genius/groupie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Genius/groupie/git/refs{/sha}","trees_url":"https://api.github.com/repos/Genius/groupie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Genius/groupie/statuses/{sha}","languages_url":"https://api.github.com/repos/Genius/groupie/languages","stargazers_url":"https://api.github.com/repos/Genius/groupie/stargazers","contributors_url":"https://api.github.com/repos/Genius/groupie/contributors","subscribers_url":"https://api.github.com/repos/Genius/groupie/subscribers","subscription_url":"https://api.github.com/repos/Genius/groupie/subscription","commits_url":"https://api.github.com/repos/Genius/groupie/commits{/sha}","git_commits_url":"https://api.github.com/repos/Genius/groupie/git/commits{/sha}","comments_url":"https://api.github.com/repos/Genius/groupie/comments{/number}","issue_comment_url":"https://api.github.com/repos/Genius/groupie/issues/comments{/number}","contents_url":"https://api.github.com/repos/Genius/groupie/contents/{+path}","compare_url":"https://api.github.com/repos/Genius/groupie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Genius/groupie/merges","archive_url":"https://api.github.com/repos/Genius/groupie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Genius/groupie/downloads","issues_url":"https://api.github.com/repos/Genius/groupie/issues{/number}","pulls_url":"https://api.github.com/repos/Genius/groupie/pulls{/number}","milestones_url":"https://api.github.com/repos/Genius/groupie/milestones{/number}","notifications_url":"https://api.github.com/repos/Genius/groupie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Genius/groupie/labels{/name}","releases_url":"https://api.github.com/repos/Genius/groupie/releases{/id}","deployments_url":"https://api.github.com/repos/Genius/groupie/deployments","created_at":"2016-09-01T20:59:35Z","updated_at":"2016-12-05T09:35:55Z","pushed_at":"2016-12-06T18:30:20Z","git_url":"git://github.com/Genius/groupie.git","ssh_url":"git@github.com:Genius/groupie.git","clone_url":"https://github.com/Genius/groupie.git","svn_url":"https://github.com/Genius/groupie","homepage":"","size":180,"stargazers_count":624,"watchers_count":624,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":13,"forks":46,"open_issues":13,"watchers":624,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Genius/groupie/pulls/44"},"html":{"href":"https://github.com/Genius/groupie/pull/44"},"issue":{"href":"https://api.github.com/repos/Genius/groupie/issues/44"},"comments":{"href":"https://api.github.com/repos/Genius/groupie/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/Genius/groupie/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/Genius/groupie/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Genius/groupie/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/Genius/groupie/statuses/db969e3264d7cfa8d52929d24d8b81424ae2bc9b"}}}}
{"actor":{"display_login":"lisawray"}}