public static function equals(Version $v1, Version $v2)
    {
        // Versionable part itself needs to be equal
        if (!self::versionableEquals($v1, $v2)) {
            return false;
        }

        // If only one has a pre-release, they're not equal
        if ($v1->hasPreRelease() && !$v2->hasPreRelease()) {
            return false;
        }
        if (!$v1->hasPreRelease() && $v2->hasPreRelease()) {
            return false;
        }

        // See if pre-releases are equal if both versions have one
        if ($v1->hasPreRelease() && $v2->hasPreRelease()) {
            if (!self::preReleaseEquals($v1->getPreRelease(), $v2->getPreRelease())) {
                return false;
            }
        }

        // If only one has a build version, they're not equal
        if (!$v1->hasBuild() && $v2->hasBuild()) {
            return false;
        }
        if ($v1->hasBuild() && !$v2->hasBuild()) {
            return false;
        }

        // Compare the build version
        if ($v1->hasBuild() && $v2->hasBuild()) {
            return self::buildEquals($v1->getBuild(), $v2->getBuild());
        }

        return true;
    }