void (String selected) { String[] options = getOptions(); for (int i = 0; i < options.length; i++) { options[i] = Strings.trimEnd(options[i], "*"); if (options[i].equals(selected)) { options[i] += "*"; } } setValue("[" + String.join("|", options) + "]"); }