void () { myFixture.configureByText("X.java", """ import java.io.*; class X { public void foo(){ try{ if(bar()){ throw new FileNotFoundException(); } else{ throw new EOFException(); } } catch(FileNotFoundException e){ e.printStackTrace(); } catch(<caret>IOException e){ e.printStackTrace(); } } } """); IntentionAction intention = myFixture.findSingleIntention("Add 'catch' clause for 'java.io.EOFException'"); myFixture.checkPreviewAndLaunchAction(intention); myFixture.checkResult(""" import java.io.*; class X { public void foo(){ try{ if(bar()){ throw new FileNotFoundException(); } else{ throw new EOFException(); } } catch(FileNotFoundException e){ e.printStackTrace(); } catch (EOFException e) { <selection><caret>throw new RuntimeException(e);</selection> } catch(IOException e){ e.printStackTrace(); } } } """); }