### Question:
RemoveUnreferencedScalarApplyNodes implements Rule<ApplyNode> { @Override public Result apply(ApplyNode applyNode, Captures captures, Context context) { return Result.ofPlanNode(applyNode.getInput()); }  @Override Pattern<ApplyNode> getPattern(); @Override Result apply(ApplyNode applyNode, Captures captures, Context context);  }### Answer:
@Test public void testDoesNotFire() { tester().assertThat(new RemoveUnreferencedScalarApplyNodes()) .on(p -> p.apply( Assignments.of(p.symbol("z"), p.expression("x IN (y)")), ImmutableList.of(), p.values(p.symbol("x")), p.values(p.symbol("y")))) .doesNotFire(); }
@Test public void testEmptyAssignments() { tester().assertThat(new RemoveUnreferencedScalarApplyNodes()) .on(p -> p.apply( Assignments.of(), ImmutableList.of(), p.values(p.symbol("x")), p.values(p.symbol("y")))) .matches(values("x")); }