@Override
    public void validate(final SingleRule rule, final SQLStatementContext sqlStatementContext, final ShardingSphereDatabase database) {
        DropSchemaStatement dropSchemaStatement = (DropSchemaStatement) sqlStatementContext.getSqlStatement();
        boolean containsCascade = dropSchemaStatement.isContainsCascade();
        for (IdentifierValue each : dropSchemaStatement.getSchemaNames()) {
            String schemaName = each.getValue();
            ShardingSphereSchema schema = database.getSchema(schemaName);
            ShardingSpherePreconditions.checkNotNull(schema, () -> new SchemaNotFoundException(schemaName));
            ShardingSpherePreconditions.checkState(containsCascade || schema.getAllTableNames().isEmpty(), () -> new DropNotEmptySchemaException(schemaName));
        }
    }
@Test
    void assertValidateWithNotExistedSchema() {
        ShardingSphereDatabase database = mockDatabase();
        when(database.getSchema("not_existed_schema")).thenReturn(null);
        assertThrows(SchemaNotFoundException.class,
                () -> new SingleDropSchemaMetaDataValidator().validate(mock(SingleRule.class, RETURNS_DEEP_STUBS), createSQLStatementContext("not_existed_schema", true), database));
    }