CloseWindowArg.Builder closeWindowBuilder = CloseWindowArg.newBuilder();
closeWindowBuilder.setWindowID(windowId);
Response response = executeMessage(WindowManagerMessage.CLOSE_WINDOW, closeWindowBuilder);
new ImplicitWait(WINDOW_CLOSE_TIMEOUT.getValue(), INTERNAL_FREQUENCY.getValue())
.until(new Callable<Boolean>() {
public Boolean call() {
return !windows.containsKey(windowId);
}
});