### Question:
CsvTable extends AbstractTable { private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { final GetField getFields = stream.readFields(); Object columns = getFields.get("_columns", null); if (columns instanceof Column[]) { columns = Arrays.<Column> asList((Column[]) columns); } final Object schema = getFields.get("_schema", null); final Object tableName = getFields.get("_tableName", null); LegacyDeserializationObjectInputStream.setField(CsvTable.class, this, "_columns", columns); LegacyDeserializationObjectInputStream.setField(CsvTable.class, this, "_schema", schema); LegacyDeserializationObjectInputStream.setField(CsvTable.class, this, "_tableName", tableName); } CsvTable(CsvSchema schema, String tableName, List<String> columnNames);  CsvTable(CsvSchema schema, String tableName); @Override String getName(); @Override List<Column> getColumns(); @Override Schema getSchema(); @Override TableType getType(); @Override Collection<Relationship> getRelationships(); @Override String getRemarks(); @Override String getQuote();  }### Answer:
@Test public void testDeserializeOldTable() throws Exception { final File file = new File("src/test/resources/MetaModel-4.6.0-CsvTable.ser"); try (LegacyDeserializationObjectInputStream in = new LegacyDeserializationObjectInputStream(new FileInputStream(file))) { final Object object = in.readObject(); assertPeopleCsv(object); } }
@Test public void testSerializeAndDeserializeCurrentVersion() throws Exception { final DataContext dc = new CsvDataContext(new File("src/test/resources/csv_people.csv")); final Table table1 = dc.getDefaultSchema().getTables().get(0); assertPeopleCsv(table1); final byte[] bytes = SerializationUtils.serialize(table1); try (LegacyDeserializationObjectInputStream in = new LegacyDeserializationObjectInputStream(new ByteArrayInputStream(bytes))) { final Object object = in.readObject(); assertPeopleCsv(object); } }