public boolean isCompatibleWith(DockerImageName other) {
        // Make sure we always compare against a version of the image name containing the LIBRARY_PREFIX
        String finalImageName;
        if (this.repository.startsWith(LIBRARY_PREFIX)) {
            finalImageName = this.repository;
        } else {
            finalImageName = LIBRARY_PREFIX + this.repository;
        }
        DockerImageName imageWithLibraryPrefix = DockerImageName.parse(finalImageName);
        if (other.equals(this) || imageWithLibraryPrefix.equals(this)) {
            return true;
        }

        if (this.compatibleSubstituteFor == null) {
            return false;
        }

        return this.compatibleSubstituteFor.isCompatibleWith(other);
    }
Test whether this {@link DockerImageName} has declared compatibility with another image (set using
{@link DockerImageName#asCompatibleSubstituteFor(String)} or
{@link DockerImageName#asCompatibleSubstituteFor(DockerImageName)}.
<p>
If a version tag part is present in the <code>other</code> image name, the tags must exactly match, unless it
is 'latest'. If a version part is not present in the <code>other</code> image name, the tag contents are ignored.

@param other the other image that we are trying to test compatibility with
@return whether this image has declared compatibility.
core/src/main/java/org/testcontainers/utility/DockerImageName.java