class AbstractLocation implements Location {

    @Override
    public final boolean childOf(Location other) {
        Validate.notNull(other, "other must not be null");
        Integer firstId = CollectionHelper.getFirst(this.getAncestorIds());
        if (firstId == null) {
            return false;
        }
        return firstId == other.getId();
    }

}