private <T> T deserialize(byte[] bytes, TypeReference<T> reference) {
    try {
      if (bytes != null) {
        String valueStr = new String((byte[]) bytes, "UTF-8");
        return SamzaObjectMapper.getObjectMapper().readValue(valueStr, reference);
      }
    } catch (Exception e) {
      throw new SamzaException(e);
    }

    return null;
  }
This class is a unit test for the CoordinatorStreamWriter class.
samza-core/src/test/java/org/apache/samza/coordinator/stream/TestCoordinatorStreamWriter.java