### Question:
OciIndexTemplate implements ManifestTemplate { public void addManifest(BlobDescriptor descriptor, String imageReferenceName) { BuildableManifestTemplate.ContentDescriptorTemplate contentDescriptorTemplate = new BuildableManifestTemplate.ContentDescriptorTemplate( OciManifestTemplate.MANIFEST_MEDIA_TYPE, descriptor.getSize(), descriptor.getDigest()); contentDescriptorTemplate.setAnnotations( ImmutableMap.of("org.opencontainers.image.ref.name", imageReferenceName)); manifests.add(contentDescriptorTemplate); }  @Override int getSchemaVersion(); @Override String getManifestMediaType(); void addManifest(BlobDescriptor descriptor, String imageReferenceName); @VisibleForTesting List<BuildableManifestTemplate.ContentDescriptorTemplate> getManifests(); static final String MEDIA_TYPE; }### Answer:
@Test public void testToJson() throws DigestException, IOException, URISyntaxException { Path jsonFile = Paths.get(Resources.getResource("core/json/ociindex.json").toURI()); String expectedJson = new String(Files.readAllBytes(jsonFile), StandardCharsets.UTF_8); OciIndexTemplate ociIndexJson = new OciIndexTemplate(); ociIndexJson.addManifest( new BlobDescriptor( 1000, DescriptorDigest.fromDigest( "sha256:8c662931926fa990b41da3c9f42663a537ccd498130030f9149173a0493832ad")), "regis.try/repo:tag"); Assert.assertEquals(expectedJson, JsonTemplateMapper.toUtf8String(ociIndexJson)); }