### Question:
WindowStateAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.WindowStateListener { public org.apache.pivot.util.Vote previewWindowOpen(org.apache.pivot.wtk.Window arg0) { if (previewWindowOpen != null) { return previewWindowOpen.call(arg0); } return Vote.APPROVE; }  CallableWithArgs<Vote> getPreviewWindowOpen(); CallableWithArgs<Void> getWindowOpenVetoed(); CallableWithArgs<Vote> getPreviewWindowClose(); CallableWithArgs<Void> getWindowCloseVetoed(); CallableWithArgs<Void> getWindowOpened(); CallableWithArgs<Void> getWindowClosed(); void setPreviewWindowOpen(CallableWithArgs<Vote> previewWindowOpen); void setWindowOpenVetoed(CallableWithArgs<Void> windowOpenVetoed); void setPreviewWindowClose(CallableWithArgs<Vote> previewWindowClose); void setWindowCloseVetoed(CallableWithArgs<Void> windowCloseVetoed); void setWindowOpened(CallableWithArgs<Void> windowOpened); void setWindowClosed(CallableWithArgs<Void> windowClosed); org.apache.pivot.util.Vote previewWindowOpen(org.apache.pivot.wtk.Window arg0); void windowOpenVetoed(org.apache.pivot.wtk.Window arg0, org.apache.pivot.util.Vote arg1); org.apache.pivot.util.Vote previewWindowClose(org.apache.pivot.wtk.Window arg0); void windowCloseVetoed(org.apache.pivot.wtk.Window arg0, org.apache.pivot.util.Vote arg1); void windowOpened(org.apache.pivot.wtk.Window arg0); void windowClosed(org.apache.pivot.wtk.Window arg0, org.apache.pivot.wtk.Display arg1, org.apache.pivot.wtk.Window arg2);  }### Answer:
@Test public void testPreviewWindowOpen() { final boolean[] invoked = new boolean[1]; CallableWithArgs<org.apache.pivot.util.Vote> callable = new CallableWithArgs<org.apache.pivot.util.Vote>() { public org.apache.pivot.util.Vote call(Object... args) { invoked[0] = true; return null; } }; assertNull(adapter.getPreviewWindowOpen()); adapter.previewWindowOpen(null); assertFalse(invoked[0]); adapter.setPreviewWindowOpen(callable); adapter.previewWindowOpen(null); assertTrue(invoked[0]); }