@Test public void dontAddProjectForProjectOperator() { Project project = Mockito.mock(Project.class); UnresolvedExpression expression = Mockito.mock(UnresolvedExpression.class); when(project.isExcluded()).thenReturn(false); when(project.getProjectList()).thenReturn(Arrays.asList(expression)); UnresolvedPlan plan = UnresolvedPlanHelper.addSelectAll(project); assertTrue(plan instanceof Project); assertThat(((Project) plan).getProjectList(), Matchers.contains(expression)); }
public UnresolvedPlan addSelectAll(UnresolvedPlan plan) { if ((plan instanceof Project) && !((Project) plan).isExcluded()) { return plan; } else { return new Project(ImmutableList.of(AllFields.of())).attach(plan); } }
UnresolvedPlanHelper { public UnresolvedPlan addSelectAll(UnresolvedPlan plan) { if ((plan instanceof Project) && !((Project) plan).isExcluded()) { return plan; } else { return new Project(ImmutableList.of(AllFields.of())).attach(plan); } } }
UnresolvedPlanHelper { public UnresolvedPlan addSelectAll(UnresolvedPlan plan) { if ((plan instanceof Project) && !((Project) plan).isExcluded()) { return plan; } else { return new Project(ImmutableList.of(AllFields.of())).attach(plan); } }  }
UnresolvedPlanHelper { public UnresolvedPlan addSelectAll(UnresolvedPlan plan) { if ((plan instanceof Project) && !((Project) plan).isExcluded()) { return plan; } else { return new Project(ImmutableList.of(AllFields.of())).attach(plan); } }  UnresolvedPlan addSelectAll(UnresolvedPlan plan); }
UnresolvedPlanHelper { public UnresolvedPlan addSelectAll(UnresolvedPlan plan) { if ((plan instanceof Project) && !((Project) plan).isExcluded()) { return plan; } else { return new Project(ImmutableList.of(AllFields.of())).attach(plan); } }  UnresolvedPlan addSelectAll(UnresolvedPlan plan);  }