StdArrangementTokenUiRole (@NotNull ArrangementSettingsToken token) { final StdArrangementTokenUiRole role = token instanceof StdArrangementSettingsToken ? ((StdArrangementSettingsToken)token).getTokenType().getUiRole() : null; if (role == null) { throw new IllegalArgumentException("Can't deduce UI role for token " + token); } return role; }