Unable to print getContextHandles() using a Set<>

Hi,

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

	 Set<String> contextNames = driver.getContextHandles();
	    for (String contextName : contextNames)
	    {
	        System.out.println(contextName);
	    }

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()) {
	    System.out.print(itr.next()+",");
	}