@Test
  public void testSerdeEmptySamzaEpochIdInHeader() {
    DiagnosticsStreamMessage diagnosticsStreamMessage = getDiagnosticsStreamMessage(Optional.empty());
    MetricsSnapshot metricsSnapshot = diagnosticsStreamMessage.convertToMetricsSnapshot();
    MetricsHeader expectedHeader =
        new MetricsHeader(JOB_NAME, JOB_ID, CONTAINER_NAME, EXECUTION_ENV_CONTAINER_ID, Optional.empty(),
            DiagnosticsManager.class.getName(), TASK_CLASS_VERSION, SAMZA_VERSION, HOSTNAME, timestamp, resetTimestamp);
    Assert.assertEquals(metricsSnapshot.getHeader(), expectedHeader);

    DiagnosticsStreamMessage convertedDiagnosticsStreamMessage =
        DiagnosticsStreamMessage.convertToDiagnosticsStreamMessage(metricsSnapshot);
    Assert.assertEquals(convertedDiagnosticsStreamMessage, diagnosticsStreamMessage);
  }
Tests serialization and deserialization of a {@link DiagnosticsStreamMessage}
samza-core/src/test/java/org/apache/samza/diagnostics/TestDiagnosticsStreamMessage.java