/**
  * Sets the value of a specific piece of statistics. The method assumes that the caller has
  * acquired the write lock of {@link #lock} and, thus, allows the optimization of batch updates to
  * multiple pieces of statistics.
  *
  * @param stat the piece of statistics to set
  * @param value the value of the piece of statistics to set
  */
 protected void unlockedSetStat(String stat, Object value) {
   if (value == null) stats.remove(stat);
   else stats.put(stat, value);
 }