@Override
    public Optional<ResultDecorator<EncryptRule>> newInstance(final RuleMetaData globalRuleMetaData, final ShardingSphereDatabase database,
                                                              final EncryptRule encryptRule, final ConfigurationProperties props, final SQLStatementContext sqlStatementContext) {
        if (sqlStatementContext instanceof SelectStatementContext) {
            return Optional.of(new EncryptDQLResultDecorator(database, encryptRule, (SelectStatementContext) sqlStatementContext));
        }
        if (sqlStatementContext.getSqlStatement() instanceof DALStatement) {
            return Optional.of(new EncryptDALResultDecorator(globalRuleMetaData));
        }
        return Optional.empty();
    }
@Test
    void assertNewInstanceWithSelectStatement() {
        EncryptResultDecoratorEngine engine = (EncryptResultDecoratorEngine) OrderedSPILoader.getServices(ResultProcessEngine.class, Collections.singleton(rule)).get(rule);
        Optional<ResultDecorator<EncryptRule>> actual =
                engine.newInstance(mock(RuleMetaData.class), database, rule, mock(ConfigurationProperties.class), mock(SelectStatementContext.class, RETURNS_DEEP_STUBS));
        assertTrue(actual.isPresent());
        assertThat(actual.get(), instanceOf(EncryptDQLResultDecorator.class));
    }