### Question:
ForumStructureItem { public PoulpeBranch getBranchItem() { return (PoulpeBranch) item; } ForumStructureItem();  ForumStructureItem(@Nullable Entity item); Entity getItem(); boolean isBranch(); boolean isSection(); boolean isPersisted(); PoulpeBranch getBranchItem(); PoulpeSection getSectionItem(); ForumStructureItem prepareBranchItemForEditing(boolean createNew); ForumStructureItem prepareSectionItemForEditing(boolean createNew); T getItem(@Nonnull Class<T> itemClass); @Override String toString(); String getDraggableId(); String getDroppableId(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testGetItemAsBranch() throws Exception { PoulpeBranch branch = new PoulpeBranch(); ForumStructureItem item = new ForumStructureItem(branch); assertSame(item.getBranchItem(), branch); }
@Test(expectedExceptions = ClassCastException.class) public void testGetItemAsBranch_isNotBranch() throws Exception { ForumStructureItem item = new ForumStructureItem(new PoulpeSection()); item.getBranchItem(); }
@Test public void testGetItemAsBranch_isNull() throws Exception { assertNull(new ForumStructureItem(null).getBranchItem()); }