TodoItemNode (TodoItemNode pointer) { Object sibling = getPreviousSibling(pointer); if (sibling == null) { return null; } if (sibling instanceof TodoItemNode) { return (TodoItemNode)sibling; } else { return getLastPointerForElement(sibling); } }