### Question:
ForumStructureItem { public boolean isPersisted() { return item != null && item.getId() != 0; } 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 testIsPersisted_withNotPersisted() throws Exception { ForumStructureItem item = new ForumStructureItem(new PoulpeBranch()); assertFalse(item.isPersisted()); }
@Test public void testIsPersisted_withNull() throws Exception { assertFalse(new ForumStructureItem(null).isPersisted()); }
@Test public void testIsPersisted_withPersisted() throws Exception { PoulpeBranch branch = new PoulpeBranch(); branch.setId(1L); ForumStructureItem item = new ForumStructureItem(branch); assertTrue(item.isPersisted()); }