Currently there are two strategies for materialized view matching:
strategy-1. Substitution based (SubstitutionVisitor.java) 
strategy-2. Plan structural information based (AbstractMaterializedViewRule.java) 
The two strategies are controlled by a single connection config of "materializationsEnabled". Calcite will apply strategy-1 firstly and then strategy-2.
The two strategies are tested in a single integration test called MaterializationTest.java,
As a result we cannot run tests separately for a single strategy, which leads to:
- When some new matching patterns are supported by strategy-1, we might need to update the old result plan, which was previously matched and generated by stragegy-2, e.g. , and corresponding testing pattern for stragegy-2 will be lost.
- Some test failures are even hidden, e.g. MaterializationTest#testJoinMaterialization2 should but failed to be supported by stragegy-2. However strategy-1 lets the test passed.
- Hard to test internals for SubstutionVisitor.java, e.g.  has to struggle and create a unit test
Of course we can add more system config or connection config just for testing and circle around some of the dilemmas I mentioned above. But it will make the code messy. Materialized view matching strategies are so important and worth a through unit test and to be kept clean.
Additionally, this JIRA targets to clean the code of MaterializationTest.java. As more and more fixes get applied, this Java file tends to be messy:
- Helping methods and testing methods are mixed without good order.
- Lots of methods called checkMaterialize. We need to sort it out if there's need to add more params, e.g. 
- Some tests are not concise enough, e.g. testJoinMaterialization9
1. Create unit test MaterializedViewSubstitutionVisitorTest to test strategy-1
2. Create unit test MaterializedViewRelOptRulesTest to test strategy-2
3. Move tests from MaterializationTest to unit tests correspondingly, and keep MaterializationTest for integration tests.