code: private static Node getNthSibling(Node first, int index) {
      Node sibling = first;
      while (index != 0 && sibling != null) {
        sibling = sibling.getNext();
        index--;
      }
      return sibling;
    }
docs: Given the first sibling, this returns the nth
  sibling or null if no such sibling exists.
  This is like "getChildAtIndex" but returns null for non-existent indexes.