}
int major = parseVersionPart(parts[0]);
int minor = parseVersionPart(parts[1]);
int patch = (parts.length > 2) ? parseVersionPart(parts[2]) : 0;
String snapshot = (parts.length > 3) ? parts[3] : null;
return new Version(major, minor, patch, snapshot);
}