code: public static AssociativeArray frequencies(FlatDataCollection flatDataCollection) {
          AssociativeArray frequencies = new AssociativeArray();
          
          for (Object value : flatDataCollection) {
              Object counter = frequencies.get(value);
              if(counter==null) {
                  frequencies.put(value, 1);
              }
              else {
                  frequencies.put(value, ((Number)counter).intValue()+1);
              }
          }
          
          return frequencies;
      }
docs: Calculates the Frequency Table
  
  @param flatDataCollection
  @return