WorkflowVersion { public boolean isLargerThan(WorkflowVersion other) { if (this.majorVersion > other.majorVersion) return true; if (this.majorVersion == other.majorVersion && this.minorVersion > other.minorVersion) return true; if (this.majorVersion == other.majorVersion && this.minorVersion == other.minorVersion && this.patchLevel > other.patchLevel) return true; return false; } WorkflowVersion(long majorVersion, long minorVersion, long patchLevel); long getMajorVersion(); long getMinorVersion(); long getPatchLevel(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); String format(); boolean isLargerThan(WorkflowVersion other);  }
@Test public void testIsLargerThan() { final WorkflowVersion a = new WorkflowVersion(1, 2, 3); assertTrue(a.equals(a)); assertFalse(a.isLargerThan(a)); final WorkflowVersion b = new WorkflowVersion(1, 3, 0); assertFalse(a.equals(b)); assertTrue(b.isLargerThan(a)); }