ValidationUtil { public static boolean version(String version) { return VERSION_REGEX.isValid(version); } private  ValidationUtil(); static boolean username(String user); static boolean group(String group); static boolean password(String password); static boolean privateIP(String ip); static boolean address(String address); static boolean port(String port); static boolean port(int port); static boolean path(String path); static boolean version(String version); static boolean email(String email); static boolean ipv4(String ipv4); static final int USER_MAX; static final int USER_MIN; static final int GROUP_MAX; static final int GROUP_MIN; static final int PASSWORD_MAX; static final int PASSWORD_MIN; }
@Test void testVersionSimple() { assertFalse(version(null)); assertFalse(version("5..0")); assertFalse(version("5..0.0")); assertFalse(version("5.0.0.0")); assertTrue(version("5.0.0")); assertTrue(version("05.00.00")); }
@Test void testVersionWithBuild() { assertFalse(version("5.0.0--0")); assertFalse(version("5.0.0-")); assertTrue(version("5.0.0-9")); assertTrue(version("5.0.0-92833434")); }