code: public static boolean containsOnly(Stream stream, long size){
          long count = 0L;
          Iterator it = stream.iterator();
  
          while(it.hasNext()){
              it.next();
              if(++count > size) return false;
          }
  
          return size == count;
      }
docs: Helper which lazily checks if a {@link Stream} contains the number specified
  WARNING: This consumes the stream rendering it unusable afterwards
  
  @param stream the {@link Stream} to check the count against
  @param size the expected number of elements in the stream
  @return true if the expected size is found