class DefaultModelLocator implements ModelLocator {

    @Deprecated
    @Override
    public File locatePom(File projectDirectory) {
        Path path = locatePom(projectDirectory != null ? projectDirectory.toPath() : null);
        return path != null ? path.toFile() : null;
    }

    @Override
    public Path locatePom(Path projectDirectory) {
        return projectDirectory != null ? projectDirectory : Paths.get(System.getProperty("user.dir"));
    }

    @Deprecated
    @Override
    public File locateExistingPom(File project) {
        Path path = locateExistingPom(project != null ? project.toPath() : null);
        return path != null ? path.toFile() : null;
    }

    @Override
    public Path locateExistingPom(Path project) {<FILL_FUNCTION_BODY>}
}

        if (project == null || Files.isDirectory(project)) {
            project = locatePom(project);
        }
        if (Files.isDirectory(project)) {
            Path pom = project.resolve("pom.xml");
            return Files.isRegularFile(pom) ? pom : null;
        } else if (Files.isRegularFile(project)) {
            return project;
        } else {
            return null;
        }
    
<no_super_class>