String (Object object) { String result = null; if (object instanceof SortableTreeElement) { result = ((SortableTreeElement)object).getAlphaSortKey(); } else if (object instanceof TreeElement) { result = ((TreeElement)object).getPresentation().getPresentableText(); } else if (object instanceof Group) { result = ((Group)object).getPresentation().getPresentableText(); } return result == null ? "" : result; }