public void validateArtifacts(List<ResolvedArtifact> resolvedArtifacts) {
        for (ResolvedArtifact artifact : resolvedArtifacts) {
            LockedArtifact pin = artifacts.get(artifact.getCoordinates());
            if (pin == null) {
                throw new CliError("Resolved artifact `" + artifact + "` not found in locked artifacts.");
            }
            if (!pin.matchesResolved(artifact)) {
                throw new CliError("Resolved artifact `" + artifact + "` does not match locked artifact `" + pin + "`");
            }
        }
    }
Loads lockfile from path if it exists.

@param path path of file to load as a lockfile
@return Lockfile if it exists otherwise Optional.empty().
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/LockFile.java