@Test
public void shouldHaveNestedRuleAlwaysSetJoinAlgorithmToNestedLoop() {

    PlanNode join = new PlanNode(Type.JOIN, selector("Selector1"), selector("Selector2"));
    PlanNode s1Source = new PlanNode(Type.SOURCE, join, selector("Selector1"));
    PlanNode s2Source = new PlanNode(Type.SOURCE, join, selector("Selector2"));
    // Set the join type ...
    join.setProperty(Property.JOIN_TYPE, JoinType.INNER);
    // Execute the rule ...
    PlanNode result = nestedRule.execute(context, join, new LinkedList<OptimizerRule>());
    assertThat(result, is(sameInstance(join)));
    assertThat(join.getProperty(Property.JOIN_TYPE, JoinType.class), is(JoinType.INNER));
    assertThat(join.getProperty(Property.JOIN_ALGORITHM, JoinAlgorithm.class), is(JoinAlgorithm.NESTED_LOOP));
    assertChildren(join, s1Source, s2Source);
}