### Question:
SchemaUpdate implements UpdateSchema { @Override public UpdateSchema addColumn(String name, Type type) { Preconditions.checkArgument(!name.contains("."), "Cannot add column with ambiguous name: %s, use addColumn(parent, name, type)", name); return addColumn(null, name, type); } SchemaUpdate(TableOperations ops);   SchemaUpdate(Schema schema, int lastColumnId); @Override UpdateSchema addColumn(String name, Type type); @Override UpdateSchema addColumn(String parent, String name, Type type); @Override UpdateSchema deleteColumn(String name); @Override UpdateSchema renameColumn(String name, String newName); @Override UpdateSchema updateColumn(String name, Type.PrimitiveType newType); @Override Schema apply(); @Override void commit();  }### Answer:
@Test public void testAmbiguousAdd() { AssertHelpers.assertThrows("Should reject ambiguous column name", IllegalArgumentException.class, "ambiguous name: preferences.booleans", () -> { UpdateSchema update = new SchemaUpdate(SCHEMA, SCHEMA_LAST_COLUMN_ID); update.addColumn("preferences.booleans", Types.BooleanType.get()); } ); }
@Test public void testAddAlreadyExists() { AssertHelpers.assertThrows("Should reject column name that already exists", IllegalArgumentException.class, "already exists: preferences.feature1", () -> { UpdateSchema update = new SchemaUpdate(SCHEMA, SCHEMA_LAST_COLUMN_ID); update.addColumn("preferences", "feature1", Types.BooleanType.get()); } ); AssertHelpers.assertThrows("Should reject column name that already exists", IllegalArgumentException.class, "already exists: preferences", () -> { UpdateSchema update = new SchemaUpdate(SCHEMA, SCHEMA_LAST_COLUMN_ID); update.addColumn("preferences", Types.BooleanType.get()); } ); }