public Map<SystemStreamPartition, List<IncomingMessageEnvelope>> poll(Set<SystemStreamPartition> systemStreamPartitions, long timeout) {
        Map<SystemStreamPartition, List<IncomingMessageEnvelope>> retQueues = new HashMap<>();
        systemStreamPartitions.forEach(ssp -> {
          List<IncomingMessageEnvelope> msgs = MSG_QUEUES.get(ssp);
          if (msgs == null) {
            retQueues.put(ssp, new ArrayList<>());
          } else {
            retQueues.put(ssp, MSG_QUEUES.remove(ssp));
          }
        });
        return retQueues;
      }
A mock system backed by a set of in-memory queues. Used for testing w/o actual external messaging systems.
samza-core/src/test/java/org/apache/samza/system/MockSystemFactory.java