Init () { if (myCurrentMethodRadioButton.isSelected()) return Init.CUR_METHOD; if (myFieldDeclarationRadioButton.isSelected()) return Init.FIELD_DECLARATION; if (myClassConstructorSRadioButton.isSelected()) return Init.CONSTRUCTOR; if (mySetUpMethodRadioButton.isSelected()) return Init.SETUP_METHOD; throw new IncorrectOperationException("no initialization place is selected"); }