code: static int getLeafKeyEnd(Object[] node)
      {
          int len = node.length;
          if (len == 0)
              return 0;
          else if (node[len - 1] == null)
              return len - 1;
          else
              return len;
      }
docs: get the last index that is non-null in the leaf node