DefaultVersionManager implements VersionManager { @Override public boolean checkVersionConstraint(String version, String constraint) { return StringUtils.isNullOrEmpty(constraint) || Version.valueOf(version).satisfies(constraint); }  @Override boolean checkVersionConstraint(String version, String constraint); @Override int compareVersions(String v1, String v2);  }
@Test public void checkVersionConstraint() { assertFalse(versionManager.checkVersionConstraint("1.4.3", ">2.0.0")); assertTrue(versionManager.checkVersionConstraint("1.4.3", ">=1.4.0 & <1.6.0")); }
@Test public void nullOrEmptyVersion() { assertThrows(IllegalArgumentException.class, () -> versionManager.checkVersionConstraint(null, ">2.0.0")); }
@Test public void invalidVersion() { assertThrows(ParseException.class, () -> versionManager.checkVersionConstraint("1.0", ">2.0.0")); }