### Question:
BlackHoleMetadata implements ConnectorMetadata { @Override public synchronized void createSchema(ConnectorSession session, String schemaName, Map<String, Object> properties, PrestoPrincipal owner) { if (schemas.contains(schemaName)) { throw new PrestoException(ALREADY_EXISTS, format("Schema [%s] already exists", schemaName)); } schemas.add(schemaName); } BlackHoleMetadata(); @Override List<String> listSchemaNames(ConnectorSession session); @Override synchronized void createSchema(ConnectorSession session, String schemaName, Map<String, Object> properties, PrestoPrincipal owner); @Override Optional<PrestoPrincipal> getSchemaOwner(ConnectorSession session, CatalogSchemaName schemaName); @Override Map<String, Object> getSchemaProperties(ConnectorSession session, CatalogSchemaName schemaName); @Override ConnectorTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName); @Override ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle tableHandle); @Override List<SchemaTableName> listTables(ConnectorSession session, Optional<String> schemaName); @Override Map<String, ColumnHandle> getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle); @Override ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle); @Override Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix); @Override TableStatistics getTableStatistics(ConnectorSession session, ConnectorTableHandle tableHandle, Constraint constraint); @Override void dropTable(ConnectorSession session, ConnectorTableHandle tableHandle); @Override void renameTable(ConnectorSession session, ConnectorTableHandle tableHandle, SchemaTableName newTableName); @Override void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, boolean ignoreExisting); @Override Optional<ConnectorNewTableLayout> getNewTableLayout(ConnectorSession connectorSession, ConnectorTableMetadata tableMetadata); @Override ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorNewTableLayout> layout); @Override Optional<ConnectorOutputMetadata> finishCreateTable(ConnectorSession session, ConnectorOutputTableHandle tableHandle, Collection<Slice> fragments, Collection<ComputedStatistics> computedStatistics); @Override ConnectorInsertTableHandle beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle, List<ColumnHandle> columns); @Override Optional<ConnectorOutputMetadata> finishInsert(ConnectorSession session, ConnectorInsertTableHandle insertHandle, Collection<Slice> fragments, Collection<ComputedStatistics> computedStatistics); @Override boolean usesLegacyTableLayouts(); @Override ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table); static final String SCHEMA_NAME; }### Answer:
@Test public void testCreateSchema() { assertEquals(metadata.listSchemaNames(SESSION), ImmutableList.of("default")); metadata.createSchema(SESSION, "test", ImmutableMap.of(), new PrestoPrincipal(USER, SESSION.getUser())); assertEquals(metadata.listSchemaNames(SESSION), ImmutableList.of("default", "test")); }