JTextComponent (@NotNull JComponent wrapped) { if (wrapped instanceof SearchTextField) { return ((SearchTextField)wrapped).getTextEditor(); } if (wrapped instanceof SearchTextArea) { return ((SearchTextArea)wrapped).getTextArea(); } throw new AssertionError(); }