### Question:
TableMetadata implements Serializable { @Deprecated public static TableMetadata newTableMetadata(TableOperations ops, Schema schema, PartitionSpec spec, String location, Map<String, String> properties) { return newTableMetadata(schema, spec, SortOrder.unsorted(), location, properties, DEFAULT_TABLE_FORMAT_VERSION); } @SuppressWarnings("checkstyle:CyclomaticComplexity")  TableMetadata(InputFile file,
                int formatVersion,
                String uuid,
                String location,
                long lastSequenceNumber,
                long lastUpdatedMillis,
                int lastColumnId,
                Schema schema,
                int defaultSpecId,
                List<PartitionSpec> specs,
                int defaultSortOrderId,
                List<SortOrder> sortOrders,
                Map<String, String> properties,
                long currentSnapshotId,
                List<Snapshot> snapshots,
                List<HistoryEntry> snapshotLog,
                List<MetadataLogEntry> previousFiles); @Deprecated static TableMetadata newTableMetadata(TableOperations ops,
                                               Schema schema,
                                               PartitionSpec spec,
                                               String location,
                                               Map<String, String> properties); static TableMetadata newTableMetadata(Schema schema,
                                               PartitionSpec spec,
                                               SortOrder sortOrder,
                                               String location,
                                               Map<String, String> properties); static TableMetadata newTableMetadata(Schema schema,
                                               PartitionSpec spec,
                                               String location,
                                               Map<String, String> properties); int formatVersion(); String metadataFileLocation(); String uuid(); long lastSequenceNumber(); long nextSequenceNumber(); long lastUpdatedMillis(); int lastColumnId(); Schema schema(); PartitionSpec spec(); PartitionSpec spec(int id); List<PartitionSpec> specs(); Map<Integer, PartitionSpec> specsById(); int defaultSpecId(); int defaultSortOrderId(); SortOrder sortOrder(); List<SortOrder> sortOrders(); Map<Integer, SortOrder> sortOrdersById(); String location(); Map<String, String> properties(); String property(String property, String defaultValue); boolean propertyAsBoolean(String property, boolean defaultValue); int propertyAsInt(String property, int defaultValue); long propertyAsLong(String property, long defaultValue); Snapshot snapshot(long snapshotId); Snapshot currentSnapshot(); List<Snapshot> snapshots(); List<HistoryEntry> snapshotLog(); List<MetadataLogEntry> previousFiles(); TableMetadata withUUID(); TableMetadata updateSchema(Schema newSchema, int newLastColumnId); TableMetadata updatePartitionSpec(PartitionSpec newPartitionSpec); TableMetadata updateSortOrder(SortOrder newOrder); TableMetadata addStagedSnapshot(Snapshot snapshot); TableMetadata replaceCurrentSnapshot(Snapshot snapshot); TableMetadata removeSnapshotsIf(Predicate<Snapshot> removeIf); TableMetadata replaceProperties(Map<String, String> newProperties); TableMetadata removeSnapshotLogEntries(Set<Long> snapshotIds); TableMetadata buildReplacement(Schema updatedSchema, PartitionSpec updatedPartitionSpec,
                                        SortOrder updatedSortOrder, String newLocation,
                                        Map<String, String> updatedProperties); TableMetadata updateLocation(String newLocation); TableMetadata upgradeToFormatVersion(int newFormatVersion);  }### Answer:
@Test public void testParserVersionValidation() throws Exception { String supportedVersion = toJsonWithVersion( TableMetadata.newTableMetadata(TEST_SCHEMA, SPEC_5, TEST_LOCATION, ImmutableMap.of()), TableMetadata.SUPPORTED_TABLE_FORMAT_VERSION); TableMetadata parsed = TableMetadataParser.fromJson( ops.io(), null, JsonUtil.mapper().readValue(supportedVersion, JsonNode.class)); Assert.assertNotNull("Should successfully read supported metadata version", parsed); String unsupportedVersion = toJsonWithVersion( TableMetadata.newTableMetadata(TEST_SCHEMA, SPEC_5, TEST_LOCATION, ImmutableMap.of()), TableMetadata.SUPPORTED_TABLE_FORMAT_VERSION + 1); AssertHelpers.assertThrows("Should not read unsupported metadata", IllegalArgumentException.class, "Cannot read unsupported version", () -> TableMetadataParser.fromJson( ops.io(), null, JsonUtil.mapper().readValue(unsupportedVersion, JsonNode.class))); }