void () { String s1 = """ try { aaa(); } catch(Exception ex) { LOG.assertTrue(false); }"""; String s2 = "{ LOG.assertTrue(false); }"; String s3 = "{ if (false) LOG.assertTrue(false); }"; String expectedResult = """ try { aaa(); } catch (Exception ex) { if (false) LOG.assertTrue(false); }"""; options.setToReformatAccordingToStyle(true); assertEquals("Catch replacement by block", expectedResult, replace(s1, s2, s3)); options.setToReformatAccordingToStyle(false); }