Unable to print getContextHandles() using a Set<>


I am trying to print context handles for my app with below code

	 Set<String> contextNames = driver.getContextHandles();
	    for (String contextName : contextNames)

Warnings are returned as shown in the screenshot

Replying very late to this thread, but I had to solve this as well.

You can iterate through elements in a Set, like so:

	Set<String> handles = driver.getContextHandles();
	Iterator<String> itr = handles.iterator();
	while(itr.hasNext()) {