How to determine the Number of opend Browser Windows or to iterate between them?

When I start the Chrome driver, I have a Chrome extension installed that welcomes me in a specially created browser tab. In order to be able to navigate safely between the browser tabs created in my test case, I would like to close this automatically created tab with WebUI.closeWindowIndex(index).
But how do I get index?

I came now across this thread and found this, what exactly is what I was looking for:

//Get all window handlesSet<String> allHandles = driver.getWindowHandles();
//count the handles Here count is=2
System.out.println("Count of windows:"+allHandles.size());