### Question:
CapabilitiesHelper { private static Map<String, Object> parseIntoCapabilities(String[] capabilities) { Map<String, Object> capabilityMap = new HashMap<>(); for (String eachCapability : capabilities) { String[] keyValuePair = eachCapability.split(":", 2); if (keyValuePair.length == 2) { String value = keyValuePair[1]; Object desiredCapability = value; if (value.startsWith("'") && value.endsWith("'")) { String trimmedValue = StringUtils.mid(value, 1, value.length() - 2); if (trimmedValue.equalsIgnoreCase("true")) { desiredCapability = "true"; } else if (trimmedValue.equalsIgnoreCase("false")) { desiredCapability = "false"; } } else if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("false")) { desiredCapability = Boolean.parseBoolean(value); } capabilityMap.put(keyValuePair[0], desiredCapability); } else { StringBuilder errMsg = new StringBuilder(); errMsg.append("Capabilities are to be provided as name value pair separated by colons. "); errMsg.append("For e.g., capabilityName:capabilityValue"); throw new IllegalArgumentException(errMsg.toString()); } } return capabilityMap; } private  CapabilitiesHelper(); static List<DesiredCapabilities> retrieveCustomCapsViaServiceLoaders(); @SuppressWarnings("unchecked") static List<DesiredCapabilities> retrieveCustomCapsObjects(); static DesiredCapabilities retrieveCustomCapabilities(String[] capabilitiesArray); @Deprecated static DesiredCapabilities retrieveCustomCapabilities(InvokedMethodInformation methodInfo); static DesiredCapabilities retrieveCustomCapabilities(Class<? extends DefaultCapabilitiesBuilder> builder);  }### Answer:
@Test(groups = "unit") public void testParseIntoCapabilities() { String[] capabilities = new String[2]; capabilities[0] = "capabilityName1:capabilityValue1"; capabilities[1] = "capabilityName2:capabilityValue2"; assertEquals(CapabilitiesHelper.retrieveCustomCapabilities(capabilities).getCapability("capabilityName1"), "capabilityValue1", "verify the capability is parsed properly"); }