class PathSource implements ModelSource {

    private final Path path;
    private final String location;

    PathSource(Path path) {
        this(path, null);
    }

    PathSource(Path path, String location) {
        this.path = path;
        this.location = location != null ? location : path.toString();
    }

    @Override
    public Path getPath() {
        return path;
    }

    @Override
    public InputStream openStream() throws IOException {
        return Files.newInputStream(path);
    }

    @Override
    public String getLocation() {
        return location;
    }

    @Override
    public Source resolve(String relative) {
        return new PathSource(path.resolve(relative));
    }

    @Override
    public ModelSource resolve(ModelLocator locator, String relative) {
        String norm = relative.replace('\\', File.separatorChar).replace('/', File.separatorChar);
        Path path = getPath().getParent().resolve(norm);
        Path relatedPom = locator.locateExistingPom(path);
        if (relatedPom != null) {
            return new PathSource(relatedPom.normalize(), null);
        }
        return null;
    }

    @Override
    public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

    @Override
    public int hashCode() {
        return Objects.hash(path);
    }
}

        return this == o || o instanceof PathSource ps && Objects.equals(path, ps.path);
    
<no_super_class>