VersionUtil { Optional<String> validateResponse(String currentVersion) { if (currentVersion != null && currentVersion.matches("\\d+(.\\d+)*")) { return Optional.of(currentVersion); } else { return Optional.empty(); } } VersionUtil();  VersionUtil(String currentVersionPageUrl); Optional<String> getCurrentVersion(String running, Proxy proxy, OtrosApplication otrosApplication); String getRunningVersion();  }
@Test(dataProvider = "testValidateResponse") public void testValidateResponse(String response, Optional<String> expected) throws Exception { final VersionUtil versionUtil = new VersionUtil(); final Optional<String> actual = versionUtil.validateResponse(response); assertEquals(actual, expected); }