VersionHelper { public static boolean isAfter(int[] version, int[] referenceVersion) { for (int i = 0; i < 3; i++) { if (version[i] > referenceVersion[i]) { return true; } else if (version[i] < referenceVersion[i]) { return false; } } return false; } private  VersionHelper(); static int[] extractVersion(String input); static boolean isVersion(int[] version); static boolean isBefore(int[] version, int[] referenceVersion); static boolean isAfter(int[] version, int[] referenceVersion); static boolean isEqual(int[] version, int[] referenceVersion);  }
@Test public void testIsAfter() { assertFalse(VersionHelper.isAfter(new int[] { 0, 23, 0 }, new int[] { 1, 0, 0 })); assertFalse(VersionHelper.isAfter(new int[] { 1, 23, 0 }, new int[] { 2, 0, 0 })); assertFalse(VersionHelper.isAfter(new int[] { 0, 23, 0 }, new int[] { 0, 23, 1 })); assertFalse(VersionHelper.isAfter(new int[] { 0, 23, 0 }, new int[] { 0, 23, 0 })); assertTrue(VersionHelper.isAfter(new int[] { 1, 0, 0 }, new int[] { 0, 23, 0 })); assertTrue(VersionHelper.isAfter(new int[] { 2, 0, 0 }, new int[] { 1, 23, 0 })); assertTrue(VersionHelper.isAfter(new int[] { 0, 23, 1 }, new int[] { 0, 23, 0 })); }