private CredentialsType getSelectedType() {
    for (Map.Entry<CredentialsType, TypeHandler> type2handler : myCredentialsType2Handler.entrySet()) {
      if (type2handler.getValue().getRadioButton().isSelected()) {
        return type2handler.getKey();
      }
    }
    throw new IllegalStateException();
  }
private CredentialsType getSelectedType()