### Question:
PullBaseImageStep implements Callable<ImagesAndRegistryClient> { @VisibleForTesting String lookUpPlatformSpecificImageManifest( V22ManifestListTemplate manifestListTemplate, Platform platform) throws UnlistedPlatformInManifestListException { EventHandlers eventHandlers = buildContext.getEventHandlers(); List<String> digests = manifestListTemplate.getDigestsForPlatform(platform.getArchitecture(), platform.getOs()); if (digests.size() == 0) { String errorMessage = buildContext.getBaseImageConfiguration().getImage() + " is a manifest list, but the list does not contain an image for architecture=%s, " + "os=%s. If your intention was to specify a platform for your image, see " + "https: eventHandlers.dispatch( LogEvent.error( String.format(errorMessage, platform.getArchitecture(), platform.getOs()))); throw new UnlistedPlatformInManifestListException(errorMessage); } return digests.get(0); } PullBaseImageStep(
      BuildContext buildContext, ProgressEventDispatcher.Factory progressEventDispatcherFactory); @Override ImagesAndRegistryClient call();  }### Answer:
@Test public void testLookUpPlatformSpecificImageManifest() throws IOException, UnlistedPlatformInManifestListException { String manifestListJson = " {\n" + " \"schemaVersion\": 2,\n" + " \"mediaType\": \"application/vnd.docker.distribution.manifest.list.v2+json\",\n" + " \"manifests\": [\n" + " {\n" + " \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n" + " \"size\": 424,\n" + " \"digest\": \"sha256:1111111111111111111111111111111111111111111111111111111111111111\",\n" + " \"platform\": {\n" + " \"architecture\": \"arm64\",\n" + " \"os\": \"linux\"\n" + " }\n" + " },\n" + " {\n" + " \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n" + " \"size\": 425,\n" + " \"digest\": \"sha256:2222222222222222222222222222222222222222222222222222222222222222\",\n" + " \"platform\": {\n" + " \"architecture\": \"targetArchitecture\",\n" + " \"os\": \"targetOS\"\n" + " }\n" + " }\n" + " ]\n" + "}"; V22ManifestListTemplate manifestList = JsonTemplateMapper.readJson(manifestListJson, V22ManifestListTemplate.class); String manifestDigest = pullBaseImageStep.lookUpPlatformSpecificImageManifest( manifestList, new Platform("targetArchitecture", "targetOS")); Assert.assertEquals( "sha256:2222222222222222222222222222222222222222222222222222222222222222", manifestDigest); }