public MetadataVersion metadataVersion() {
        return metadataVersion;
    }
@Test
    public void testSetMetadataVersion() {
        for (int i = MetadataVersion.MINIMUM_KRAFT_VERSION.ordinal();
                 i < MetadataVersion.VERSIONS.length;
                 i++) {
            MetadataVersion version = MetadataVersion.VERSIONS[i];
            ImageWriterOptions.Builder options = new ImageWriterOptions.Builder().
                    setMetadataVersion(version);
            if (i < MetadataVersion.MINIMUM_BOOTSTRAP_VERSION.ordinal()) {
                assertEquals(MetadataVersion.MINIMUM_KRAFT_VERSION, options.metadataVersion());
                assertEquals(version, options.requestedMetadataVersion());
            } else {
                assertEquals(version, options.metadataVersion());
            }
        }
    }