public void fire(
     DependentSubjectListener subject, Integer event, DependentSubjectListener listener) {
   // update the listener
   boolean incremented = listener.latestRevision < event.intValue();
   listener.latestRevision = event.intValue();
   // make sure the listener's dependencies were notified first
   listener.assertDependenciesSatisfiedRecursively(listener);
   // send the event forward
   if (incremented) {
     listener.increment(0);
   }
 }
 /** Register the listener as dependent on the subject. */
 public void addListener(DependentSubjectListener listener) {
   downstreamListeners.add(listener);
   listener.upstreamSubjects.add(this);
   listener.latestRevision = Math.max(listener.latestRevision, latestRevision);
   this.publisher.addListener(this, listener, DependentSubjectListenerEventFormat.INSTANCE);
 }