test_class.file: legacy/src/test/java/macrobase/analysis/summary/count/ExactCountTest.java
test_class.identifier: ExactCountTest
test_case.body: @Test
      public void testCount() {
          ExactCount ec = new ExactCount();
          HashMap<Integer, Integer> truth = new HashMap<>();
  
          List<Datum> dws = new ArrayList<>();
          for (int i = 0; i < 100; ++i) {
              for (int j = 0; j < i; ++j) {
                  dws.add(new Datum(Lists.newArrayList(i), new ArrayRealVector()));
                  truth.compute(i, (k, v) -> v == null ? 1 : v + 1);
              }
          }
  
          ec.count(dws);
  
          for (Map.Entry<Integer, Double> cnt : ec.getCounts().entrySet()) {
              assertEquals(truth.get(cnt.getKey()), cnt.getValue(), 1e-10);
          }
      }
test_case.class_method_signature: ExactCountTest.testCount()
test_case.full_signature: @Test public void testCount()
test_case.identifier: testCount
test_case.invocations: add newArrayList compute count entrySet getCounts assertEquals get getKey getValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCount()
focal_class.declarator: counts = new HashMap<>()
focal_class.modifier: private
focal_class.original_string: private HashMap<Integer, Double> counts = new HashMap<>();
focal_class.type: HashMap<Integer, Double>
focal_class.var_name: counts
focal_class.file: legacy/src/main/java/macrobase/analysis/summary/count/ExactCount.java
focal_class.identifier: ExactCount
focal_class.class_method_signature: ExactCount.getCounts()
focal_class.full_signature: public HashMap<Integer, Double> getCounts()
focal_class.identifier: getCounts
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: HashMap<Integer, Double>
focal_class.signature: HashMap<Integer, Double> getCounts()
focal_class.class_method_signature: ExactCount.count(List<Datum> data)
focal_class.full_signature: public ExactCount count(List<Datum> data)
focal_class.identifier: count
focal_class.modifiers: public
focal_class.parameters: (List<Datum> data)
focal_class.return: ExactCount
focal_class.signature: ExactCount count(List<Datum> data)
focal_method.body: public ExactCount count(List<Datum> data) {
          for (Datum d : data) {
              for (int i : d.attributes()) {
                  Double curVal = counts.get(i);
                  if (curVal == null) {
                      curVal = 0.;
                  }
                  counts.put(i, curVal + 1);
              }
          }
  
          return this;
      }
focal_method.class_method_signature: ExactCount.count(List<Datum> data)
focal_method.full_signature: public ExactCount count(List<Datum> data)
focal_method.identifier: count
focal_method.invocations: attributes get put
focal_method.modifiers: public
focal_method.parameters: (List<Datum> data)
focal_method.return: ExactCount
focal_method.signature: ExactCount count(List<Datum> data)