@Test
  public void testContainerSerDeWithoutNewFields() throws IOException {
    assumeTrue(Container.getCurrentJsonVersion() == JSON_VERSION_2);
    for (int i = 0; i < CONTAINER_COUNT; i++) {
      Container container = refContainers.get(i);

      String serializedContainerStr = objectMapper.writeValueAsString(container);
      ObjectNode newRefContainerJsonNode = (ObjectNode) objectMapper.readTree(serializedContainerStr);
      for (String fieldName : newContainerFieldNames) {
        newRefContainerJsonNode.remove(fieldName);
      }
      Container deseriazlied =
          objectMapper.readValue(objectMapper.writeValueAsString(newRefContainerJsonNode), Container.class);
      assertEquals(Container.CACHE_TTL_IN_SECOND_DEFAULT_VALUE, deseriazlied.getCacheTtlInSecond());
      assertEquals(USER_METADATA_KEYS_TO_NOT_PREFIX_IN_RESPONSE_DEFAULT_VALUE,
          deseriazlied.getUserMetadataKeysToNotPrefixInResponse());

      Container newContainer = new ContainerBuilder(deseriazlied).setCacheTtlInSecond(container.getCacheTtlInSecond())
          .setUserMetadataKeysToNotPrefixInResponse(container.getUserMetadataKeysToNotPrefixInResponse())
          .setParentAccountId(container.getParentAccountId())
          .build();

      assertEquals(container, newContainer);
    }
  }
Test container serialization and deserialization without the new fields
@throws IOException
ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java