code: @Synchronized
      public int getNumberOfSegments() {
          return assignedSegments.values().stream().mapToInt(Map::size).sum() + unassignedSegments.size();
      }
docs: Returns the number of segments currently being read from and that are unassigned within the reader group.