default Optional<T> childBefore(final Tree<?, ?> child) {
		requireNonNull(child);

		final int index = indexOf(child);
		if (index == -1) {
			throw new IllegalArgumentException("The given node is not a child.");
		}

		return index > 0
			? Optional.of(childAt(index - 1))
			: Optional.empty();
	}
Return the child which comes immediately before {@code this} node. This
method performs a linear search of this node's children for {@code child}
and is {@code O(n)} where n is the number of children.

@param child the child node
@return  the child of this node that immediately precedes the {@code child},
         or {@code null} if the given {@code node} is the first node.
@throws NullPointerException if the given {@code child} is {@code null}
jenetics.ext/src/main/java/io/jenetics/ext/util/Tree.java