public static boolean executableExists(String executable) {
        // First check if we've been given the full path already
        File directFile = new File(executable);
        if (directFile.exists() && directFile.canExecute()) {
            return true;
        }

        for (String pathString : getSystemPath()) {
            Path path = Paths.get(pathString);
            if (Files.exists(path.resolve(executable)) && Files.isExecutable(path.resolve(executable))) {
                return true;
            }
        }

        return false;
    }
Check whether an executable exists, either at a specific path (if a full path is given) or
on the PATH.

@param executable the name of an executable on the PATH or a complete path to an executable that may/may not exist
@return  whether the executable exists and is executable
core/src/main/java/org/testcontainers/utility/CommandLine.java