private static String expectedSeralizedSnapshot(boolean includeSamzaEpochId,
      boolean includeExtraHeaderField) {
    String serializedSnapshot =
        "{\"header\":{\"job-id\":\"testjobid\",\"exec-env-container-id\":\"test exec env container id\",";
    if (includeSamzaEpochId) {
      serializedSnapshot += "\"samza-epoch-id\":\"epoch-123\",";
    }
    if (includeExtraHeaderField) {
      serializedSnapshot += "\"extra-header-field\":\"extra header value\",";
    }
    serializedSnapshot +=
        "\"samza-version\":\"samzaversion\",\"job-name\":\"test-jobName\",\"host\":\"host\",\"reset-time\":2,"
            + "\"container-name\":\"samza-container-0\",\"source\":\"test source\",\"time\":1,\"version\":\"version\"},"
            + "\"metrics\":{\"test\":{\"test2\":\"foo\"}}}";
    return serializedSnapshot;
  }
Helps for verifying compatibility when schemas evolve.
samza-core/src/test/java/org/apache/samza/serializers/TestMetricsSnapshotSerde.java