public static <T extends JsonTemplate> List<T> readListOfJson(
      String jsonString, Class<T> templateClass) throws IOException {
    CollectionType listType =
        objectMapper.getTypeFactory().constructCollectionType(List.class, templateClass);
    return objectMapper.readValue(jsonString, listType);
  }
@Test
  public void testReadListOfJson() throws IOException, URISyntaxException, DigestException {
    Path jsonFile = Paths.get(Resources.getResource("core/json/basic_list.json").toURI());

    String jsonString = new String(Files.readAllBytes(jsonFile), StandardCharsets.UTF_8);
    List<TestJson> listofJsons = JsonTemplateMapper.readListOfJson(jsonString, TestJson.class);
    TestJson json1 = listofJsons.get(0);
    TestJson json2 = listofJsons.get(1);

    DescriptorDigest digest1 =
        DescriptorDigest.fromDigest(
            "sha256:91e0cae00b86c289b33fee303a807ae72dd9f0315c16b74e6ab0cdbe9d996c10");
    DescriptorDigest digest2 =
        DescriptorDigest.fromDigest(
            "sha256:8c662931926fa990b41da3c9f42663a537ccd498130030f9149173a0493832ad");

    Assert.assertEquals(1, json1.number);
    Assert.assertEquals(2, json2.number);
    Assert.assertEquals("text1", json1.text);
    Assert.assertEquals("text2", json2.text);
    Assert.assertEquals(digest1, json1.digest);
    Assert.assertEquals(digest2, json2.digest);
    Assert.assertEquals(10, json1.innerObject.number);
    Assert.assertEquals(20, json2.innerObject.number);
    Assert.assertEquals(2, json1.list.size());
    Assert.assertTrue(json2.list.isEmpty());
  }