docs: public static int[] countSegments(int[] array, int elements,
                                        int segments, int start, int limit) {
  
          int[] counts   = new int[segments];
          long  interval = calcInterval(segments, start, limit);
          int   index    = 0;
          int   element  = 0;
  
          if (interval <= 0) {
              return counts;
          }
  
          for (int i = 0; i < elements; i++) {
              element = array[i];
  
              if (element < start || element >= limit) {
                  continue;
              }
  
              index = (int) ((element - start) / interval);
  
              counts[index]++;
          }
  
          return counts;
      }