class BasicPath implements Path {

    @Override
    public Path insideTopLevel() {
        if (!getXPath().isPresent()) throw new IllegalArgumentException("must have a non-empty xpath");

        return new PathBuilder().
                withXpath(XpathUtils.insideTopLevel(getXPath().get())).
                withDescribedBy(toString()).
                build();
    }

    private  BasicPath(Optional<WebElement> underlying,
                      Optional<String> xpath,
                      List<ElementProperty> elementProperties,
                      Optional<String> xpathExplanation,
                      Optional<String> describedBy,
                      Optional<String> insideXpath,
                      Optional<String> alternateXpath
    );

}