myHousing.setVisible(true);
Condition.waitForCondition(5000, new Condition() {
public boolean getValue() {return myHousing.isVisible();}
});
assertTrue(myHousing.isVisible());
WindowListener listener = myHousing.getWindowListener();
WindowEvent event = new WindowEvent(myHousing, WindowEvent.WINDOW_CLOSING);
listener.windowClosing(event);
myHousing.setVisible(false);
Condition.waitForCondition(10000, new Condition() {
public boolean getValue() {return !myHousing.isVisible();}
});
assertFalse(myHousing.isVisible());