code: private static void _buildRankArrays(FlatDataList flatDataCollection, AssociativeArray tiesCounter, Map<Object, Double> key2AvgRank) {
          for (Object value : flatDataCollection) {
              Object count = tiesCounter.get(value);
              if (count == null) {
                  count = 0;
              }
              tiesCounter.put(value, ((Number) count).intValue() + 1);
          }
          tiesCounter.overwrite(MapMethods.<Object, Object>sortNumberMapByKeyAscending(tiesCounter.entrySet()));
          int itemCounter = 0;
          Iterator<Map.Entry<Object, Object>> it = tiesCounter.entrySet().iterator();
          while (it.hasNext()) {
              Map.Entry<Object, Object> entry = it.next();
              Object key = entry.getKey();
              double count = TypeInference.toDouble(entry.getValue());
              if (count <= 1.0) {
                  it.remove();
              }
              double avgRank = ((itemCounter + 1) + (itemCounter + count)) / 2.0;
              key2AvgRank.put(key, avgRank);
              itemCounter += count;
          }
      }
docs: Internal method used by getRanksFromValues() to produce the tiesCounter
  and key2AvgRank arrays.
  
  @param flatDataCollection
  @param tiesCounter
  @param key2AvgRank