@Test
public void testDoubleRemoval() throws Exception {

  final String shader = "void main() { if (" + Constants.GLF_DEAD + "(false)) { { { } } } }";
  final String expected = "void main() { }";
  final TranslationUnit tu = ParseHelper.parse(shader);
  final IRandom generator = new RandomWrapper(0);
  List<StmtReductionOpportunity> stmtOps = StmtReductionOpportunities
      .findOpportunities(MakeShaderJobFromFragmentShader.make(tu),
          new ReducerContext(false, ShadingLanguageVersion.ESSL_100, generator,
              new IdGenerator()));
  List<UnwrapReductionOpportunity> unwrapOps = UnwrapReductionOpportunities
      .findOpportunities(MakeShaderJobFromFragmentShader.make(tu),
          new ReducerContext(false, ShadingLanguageVersion.ESSL_100, generator,
              new IdGenerator()));
  assertFalse(stmtOps.isEmpty());
  assertFalse(unwrapOps.isEmpty());
  stmtOps.forEach(StmtReductionOpportunity::applyReduction);
  assertEquals(PrettyPrinterVisitor.prettyPrintAsString(ParseHelper.parse(expected)),
      PrettyPrinterVisitor.prettyPrintAsString(tu));
  // These should now be disabled so should do nothing.
  unwrapOps.forEach(UnwrapReductionOpportunity::applyReduction);
  assertEquals(PrettyPrinterVisitor.prettyPrintAsString(ParseHelper.parse(expected)),
        PrettyPrinterVisitor.prettyPrintAsString(tu));
}