### Question:
GUIObjectDetails { public static void validateKeysInDataFile(List<String> keysToValidate, String dataFileName, TestPlatform currentPlatform) { for (String currentKey : keysToValidate) { if (currentKey.contains(DELIMITER)) { String[] keyInContainer = currentKey.split(DELIMITER); currentKey = keyInContainer[1]; } if (!validForWebPlatform(currentPlatform, currentKey) || !validForMobilePlatforms(currentPlatform, currentKey)) { throw new IllegalArgumentException(String.format( "Detected an invalid key [%s] in data file %s for Platform %s", currentKey, dataFileName, currentPlatform.getPlatformName())); } } } GUIObjectDetails(String memberType, String memberName, String memberPackage);  GUIObjectDetails(String memberType, String memberName, String memberPackage, String parent); String getMemberType(); String getMemberName(); String getMemberPackage(); String getParent(); String returnArg(String key); String firstToUpperCase(String str); static List<GUIObjectDetails> transformKeys(List<String> keys, TestPlatform platform); static List<GUIObjectDetails> transformKeys(List<String> keys); static void validateKeysInDataFile(List<String> keysToValidate, String dataFileName,
            TestPlatform currentPlatform);  }### Answer:
@Test public void validateWebElements() throws Exception { String dataFile = "src/test/resources/SampleV2YamlPage.yaml"; DataReader reader = new DataReader(dataFile); TestPlatform currentPlatform = reader.platform(); GUIObjectDetails.validateKeysInDataFile(reader.getKeys(), dataFile, currentPlatform); }
@Test public void validateIOSElements() throws Exception { String dataFile = "src/test/resources/IOSInteractionPage.yaml"; DataReader reader = new DataReader(dataFile); TestPlatform currentPlatform = reader.platform(); GUIObjectDetails.validateKeysInDataFile(reader.getKeys(), dataFile, currentPlatform); }
@Test public void validateMobileElements() throws Exception { String dataFile = "src/test/resources/SampleMobilePage.yaml"; DataReader reader = new DataReader(dataFile); TestPlatform currentPlatform = reader.platform(); GUIObjectDetails.validateKeysInDataFile(reader.getKeys(), dataFile, currentPlatform); }
@Test public void validateCustomWebElements() throws Exception { String dataFile = "src/test/resources/CustomWebElementPage.yaml"; HtmlSeLionElementSet.getInstance().add("com.paypal.test.CustomElement"); HtmlSeLionElementSet.getInstance().add("com.paypal.test.AnotherElement"); DataReader reader = new DataReader(dataFile); TestPlatform currentPlatform = reader.platform(); GUIObjectDetails.validateKeysInDataFile(reader.getKeys(), dataFile, currentPlatform); }
@Test public void validateCustomMobileElements() throws Exception { String dataFile = "src/test/resources/CustomIOSElementPage.yaml"; IOSSeLionElementSet.getInstance().add("com.paypal.test.CustomElement"); IOSSeLionElementSet.getInstance().add("com.paypal.test.AnotherElement"); DataReader reader = new DataReader(dataFile); TestPlatform currentPlatform = reader.platform(); GUIObjectDetails.validateKeysInDataFile(reader.getKeys(), dataFile, currentPlatform); }
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testInvalidElement() throws Exception { String dataFile = "src/test/resources/SampleV2YamlPage.yaml"; DataReader reader = new DataReader(dataFile); GUIObjectDetails.validateKeysInDataFile(reader.getKeys(), dataFile, TestPlatform.IOS); }
@Test(expectedExceptions = { IllegalArgumentException.class }) public void testInvalidSeLionElement() { List<String> invalidKeyList = new ArrayList<>(); invalidKeyList.add("invalidButton1"); GUIObjectDetails.validateKeysInDataFile(invalidKeyList, "DummyPage", TestPlatform.WEB); }