code: private LinkedList<Event> computeEventCounts(EventStream eventStream, Map<String, Integer> predicatesInOut, int cutoff) {
          Set<String> predicateSet = new HashSet<>();
          Map<String, Integer> counter = new HashMap<>();
          LinkedList<Event> events = new LinkedList<>();
          while (eventStream.hasNext()) {
              Event ev = eventStream.next();
              events.addLast(ev);
              update(ev.getContext(), predicateSet, counter, cutoff);
          }
          predCounts = new int[predicateSet.size()];
          int index = 0;
          for (Iterator<String> pi = predicateSet.iterator(); pi.hasNext(); index++) {
              String predicate = pi.next();
              predCounts[index] = counter.get(predicate);
              predicatesInOut.put(predicate, index);
          }
          return events;
      }
docs: Reads events from <tt>eventStream</tt> into a linked list. The predicates associated with
  each event are counted and any which occur at least <tt>cutoff</tt> times are added to the
  <tt>predicatesInOut</tt> map along with a unique integer index.
  
  @param eventStream     an <code>EventStream</code> value
  @param predicatesInOut a <code>TObjectIntHashMap</code> value
  @param cutoff          an <code>int</code> value
  @return a <code>TLinkedList</code> value