code: private static TaskCompletionEvent getTceFromStore(TaskCompletionEvent t) {
      // Use the store so that we can save memory in simulations where there
      // are multiple task trackers in memory
      synchronized(taskCompletionEventsStore) {
        WeakReference<TaskCompletionEvent> e =
            taskCompletionEventsStore.get(t);
        // If it's not in the store, then put it in
        if (e == null) {
          taskCompletionEventsStore.put(t,
              new WeakReference<TaskCompletionEvent>(t));
          return t;
        }
        // It might be in the map, but the actual item might have been GC'ed
        // just after we got it from the map
        TaskCompletionEvent tceFromStore = e.get();
        if (tceFromStore == null) {
          taskCompletionEventsStore.put(t,
              new WeakReference<TaskCompletionEvent>(t));
          return t;
        }
        return tceFromStore;
      }
    }
docs: Given a TaskCompletionEvent, it checks the store and returns an equivalent
  copy that can be used instead. If not in the store, it adds it to the store
  and returns the same supplied TaskCompletionEvent. If the caller uses the
  stored copy, we have an opportunity to save memory.
  @param t the TaskCompletionEvent to check in the store. If not in the store
  add it
  @return the equivalent TaskCompletionEvent to use instead. May be the same
  as the one passed in.