Versions { public static Version increment(Version version) { checkNotNull(version); Version result = create(version.getNumber() + 1, currentTime()); return result; } private  Versions(); static Version zero(); static Version newVersion(int number, Timestamp timestamp); static Version increment(Version version); static void checkIsIncrement(Version currentVersion, Version newVersion);  }
@Test @DisplayName("increment Version") void increment() { Version v1 = GivenVersion.withNumber(1); assertEquals(v1.getNumber() + 1, Versions.increment(v1) .getNumber()); }