### Question:
TreeStructure { public Optional<Block> nextBlock(Block actualBlock) { Optional<Block> maybeParent = parentOf(actualBlock); if (!maybeParent.isPresent()) { return Optional.empty(); } Block parent = maybeParent.get(); List<Block> siblings = childrenOf(parent); if (isLastSibling(actualBlock, siblings)) { return nextBlock(parent); } return nextSiblingOf(actualBlock, siblings); } TreeStructure(MissionRepresentation representation, Set<Block> parallelBlocks); TreeStructure substructure(Block block); Optional<Block> nextBlock(Block actualBlock); List<Block> childrenOf(Block block); boolean isParallel(Block block); boolean isLeaf(Block block); Block rootBlock(); Set<Block> allBlocks(); boolean contains(Block block); MissionRepresentation missionRepresentation(); boolean isDescendantOf(Block target, Block source); Optional<Block> parentOf(Block block); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testNextOfLastIsNull() { assertThat(STRUCTURE.nextBlock(FOURTH)).isEmpty(); assertThat(STRUCTURE.nextBlock(FOURTH_A)).isEmpty(); }