ServerVersion { public boolean greaterThanOrEqualTo(final int major, final int minor, final int series) { if (this.major < major) { return false; } if (this.major > major) { return true; } if (this.minor < minor) { return false; } if (this.minor > minor) { return true; } return this.series >= series; } ServerVersion(final String version); boolean greaterThanOrEqualTo(final int major, final int minor, final int series);  }
@Test public void assertGreaterThan() { ServerVersion actual = new ServerVersion("5.7.12"); assertTrue(actual.greaterThanOrEqualTo(4, 0, 0)); assertTrue(actual.greaterThanOrEqualTo(5, 6, 0)); assertTrue(actual.greaterThanOrEqualTo(5, 7, 11)); }
@Test public void assertLowerThan() { ServerVersion actual = new ServerVersion("5.6.6"); assertFalse(actual.greaterThanOrEqualTo(8, 0, 0)); assertFalse(actual.greaterThanOrEqualTo(5, 7, 11)); assertFalse(actual.greaterThanOrEqualTo(5, 6, 8)); }
@Test public void assertEqualTo() { ServerVersion actual = new ServerVersion("5.6.6"); assertTrue(actual.greaterThanOrEqualTo(5, 6, 6)); }