public static CoordinatorStreamMessage deserializeCoordinatorStreamMessage(OutgoingMessageEnvelope msg) {
    JsonSerde<List<?>> keySerde = new JsonSerde<>();
    Object[] keyArray = keySerde.fromBytes((byte[]) msg.getKey()).toArray();
    JsonSerde<Map<String, Object>> msgSerde = new JsonSerde<>();
    Map<String, Object> valueMap = msgSerde.fromBytes((byte[]) msg.getMessage());
    return new CoordinatorStreamMessage(keyArray, valueMap);
  }
Helper for creating mock CoordinatorStreamConsumer and
CoordinatorStreamConsumer. The CoordinatorStreamConsumer is meant to just
forward all configs to JobCoordinator, which is useful for mocking in unit
tests.
samza-core/src/test/java/org/apache/samza/coordinator/stream/MockCoordinatorStreamSystemFactory.java