boolean thenHasSideEffects,
boolean elseHasSideEffects,
List<String> expected) {
Compiler compiler = new Compiler();
List<Node> replacements = Lists.newArrayList();
GetReplacementSideEffectSubexpressions accumulator =
new GetReplacementSideEffectSubexpressions(compiler, replacements);
accumulator.keepSimplifiedHookExpression(root,
thenHasSideEffects,
elseHasSideEffects);
List<String> actual = Lists.newArrayList();
for (Node replacement : replacements) {
actual.add(compiler.toSource(replacement));