naming/src/main/java/org/jboss/as/naming/util/NamingUtils.java
public static String getLastComponent(final Name name) {
        if(name.size() > 0)
            return name.get(name.size() - 1);
        return "";
    }
public static String getLastComponent(final Name name) {
        if(name.size() > 0)
            return name.get(name.size() - 1);
        return "";
    }
Get the last component of a name.

@param name the name
@return the last component