code: static <E> boolean setCountImpl(Multiset<E> self, E element, int oldCount, int newCount) {
      checkNonnegative(oldCount, "oldCount");
      checkNonnegative(newCount, "newCount");
  
      if (self.count(element) == oldCount) {
        self.setCount(element, newCount);
        return true;
      } else {
        return false;
      }
    }
docs: An implementation of {@link Multiset#setCount(Object, int, int)}.