util-naming/src/main/java/com/hpe/caf/naming/Name.java
public Name getPrefix(final int upperIndex)
    {
        if (upperIndex < 0 || upperIndex > components.size()) {
            throw new IllegalArgumentException("Index out of bounds");
        }
        return new Name(components.subList(0, upperIndex));
    }
public Name getPrefix(final int upperIndex)
    {
        if (upperIndex < 0 || upperIndex > components.size()) {
            throw new IllegalArgumentException("Index out of bounds");
        }
        return new Name(components.subList(0, upperIndex));
    }
Return a Name that consists of a subsection of the current Name.

@param upperIndex the upper index (exclusive) of components to build the Name from
@return a new Name, that is a sub-set of the current Name
@throws IllegalArgumentException if you request an index that is no in the range of components of this Name