code: public static int getFlattenedItemsCount(final Object... items) {
  
          return stream(items)
              .map(item -> item.getClass().isArray() ? getFlattenedItemsCount((Object[]) item) : 1)
              .reduce(0, Integer::sum);
      }
docs: Returns the total number of non array items held in the specified array,
  recursively descending in every array item.
  
  @param items
  comma separated sequence of {@link Object} items
  
  @return integer specifying the total number of itemsnew