AbstractBlockWrapper (AbstractBlockWrapper block) { List<AbstractBlockWrapper> children = block.getParent().getChildren(); int nextBlockIndex = children.indexOf(block) + 1; if (nextBlockIndex < children.size()) { return children.get(nextBlockIndex); } return null; }