code: public static <E> void dotProductInPlace(Counter<E> target, Counter<E> term) {
      for (E key : target.keySet()) {
        target.setCount(key, target.getCount(key) * term.getCount(key));
      }
    }
docs: Multiplies every count in target by the corresponding value in the term
  Counter.