MavenVersion getLatest(List<MavenVersion> allVersions) { if (allVersions == null || allVersions.isEmpty()) return null; MavenVersion latest = maxSubjectToUpperBound(allVersions); if (latest == null) { LOGGER.info("maxSubjectToUpperBound is null"); return null; } if (lookupParams.isLastVersionKnown()) { LOGGER.info("lastKnownVersion is " + lookupParams.getLastKnownVersion()); MavenVersion lastKnownVersion = new MavenVersion(lookupParams.getLastKnownVersion()); if (noNewerVersion(latest, lastKnownVersion)) { LOGGER.info("no newer version"); return null; } } if (!lookupParams.lowerBoundGiven() || latest.greaterOrEqual(lookupParams.lowerBound())) { return latest; } else { LOGGER.info("latestSubjectToLowerBound is null"); return null; } }