DefaultTeiidVersion implements TeiidVersion { @Override public boolean isGreaterThan(TeiidVersion otherVersion) { TeiidVersion myMinVersion = getMinimumVersion(); TeiidVersion otherMaxVersion = otherVersion.getMaximumVersion(); int majCompResult = isOtherNumberGreaterThan(myMinVersion.getMajor(), otherMaxVersion.getMajor()); if (majCompResult > 0) return true; int minCompResult = isOtherNumberGreaterThan(myMinVersion.getMinor(), otherMaxVersion.getMinor()); if (majCompResult == 0 && minCompResult > 0) return true; int micCompResult = isOtherNumberGreaterThan(myMinVersion.getMicro(), otherMaxVersion.getMicro()); if (majCompResult == 0 && minCompResult == 0 && micCompResult > 0) return true; return false; } DefaultTeiidVersion(String major, String minor, String micro);  DefaultTeiidVersion(String versionString); @Override String toString(); @Override String getMajor(); @Override String getMinor(); @Override String getMicro(); @Override boolean hasWildCards(); @Override int hashCode(); @Override boolean equals(Object obj); @Override boolean compareTo(TeiidVersion otherVersion); @Override boolean isSevenInstance(); @Override TeiidVersion getMinimumVersion(); @Override TeiidVersion getMaximumVersion(); @Override boolean isGreaterThan(TeiidVersion otherVersion); @Override boolean isGreaterThan(Version otherVersion); @Override boolean isLessThan(TeiidVersion otherVersion); @Override boolean isLessThan(Version otherVersion); @Override boolean isGreaterThanOrEqualTo(TeiidVersion otherVersion); @Override boolean isGreaterThanOrEqualTo(Version otherVersion); @Override boolean isLessThanOrEqualTo(TeiidVersion otherVersion); @Override boolean isLessThanOrEqualTo(Version otherVersion);  }
@Test public void testIsGreaterThan() { assertFalse(version("8.0.0").isGreaterThan(version("8.0.0"))); assertTrue(version("8.0.0").isGreaterThan(version("7.0.0"))); assertFalse(version("7.0.0").isGreaterThan(version("8.0.0"))); assertTrue(version("8.0.0").isGreaterThan(version("7.7.0"))); assertFalse(version("7.7.0").isGreaterThan(version("8.0.0"))); assertTrue(version("8.0.0").isGreaterThan(version("7.0.1"))); assertFalse(version("7.0.1").isGreaterThan(version("8.0.0"))); assertTrue(version("8.0.0").isGreaterThan(version("7.0.x"))); assertFalse(version("7.0.x").isGreaterThan(version("8.0.0"))); assertTrue(version("8.0.0").isGreaterThan(version("7.x.0"))); assertFalse(version("7.x.0").isGreaterThan(version("8.0.0"))); assertTrue(version("8.0.0").isGreaterThan(version("7.x.x"))); assertFalse(version("7.x.x").isGreaterThan(version("8.0.0"))); assertTrue(version("8.x.0").isGreaterThan(version("7.0.0"))); assertFalse(version("7.0.0").isGreaterThan(version("8.x.0"))); assertTrue(version("8.0.x").isGreaterThan(version("7.0.0"))); assertFalse(version("7.0.0").isGreaterThan(version("8.0.x"))); assertTrue(version("8.x.x").isGreaterThan(version("7.0.0"))); assertFalse(version("7.0.0").isGreaterThan(version("8.x.x"))); assertTrue(version("8.0.x").isGreaterThan(version("7.0.0"))); assertFalse(version("7.0.0").isGreaterThan(version("8.0.x"))); assertTrue(version("8.x.0").isGreaterThan(version("7.0.0"))); assertFalse(version("7.0.0").isGreaterThan(version("8.x.0"))); assertFalse(version("8.0.x").isGreaterThan(version("8.0.0"))); assertFalse(version("8.0.0").isGreaterThan(version("8.0.x"))); assertFalse(version("8.x.0").isGreaterThan(version("8.0.0"))); assertFalse(version("8.0.0").isGreaterThan(version("8.x.0"))); assertTrue(version("8.1.extendedmicroversionid").isGreaterThan(version("8.0.0"))); assertTrue(version("8.designer-2.0").isGreaterThan(version("8.designer-1.0"))); assertTrue(version("8.designer-10.0").isGreaterThan(version("8.designer-1.0"))); assertTrue(version("8.teiidteiid-18.0").isGreaterThan(version("8.designer-20.0"))); assertFalse(version("8.designer-20.0").isGreaterThan(version("8.teiidteiid-18.0"))); assertTrue(version("8.11.0").isGreaterThan(version("8.8.0"))); assertTrue(version("8.10.0").isGreaterThan(version("8.8.0"))); assertTrue(version("8.10.1").isGreaterThan(version("8.10.0"))); assertFalse(version("8.10.1").isGreaterThan(version("8.11.0"))); assertFalse(version("8.7.1").isGreaterThan(version("8.7.x"))); assertTrue(version("8.12.4").isGreaterThan(version("8.9.0"))); }