### Question:
SheetStateAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.SheetStateListener { public org.apache.pivot.util.Vote previewSheetClose(org.apache.pivot.wtk.Sheet arg0, boolean arg1) { if (previewSheetClose != null) { return previewSheetClose.call(arg0, arg1); } return Vote.APPROVE; }  CallableWithArgs<Vote> getPreviewSheetClose(); CallableWithArgs<Void> getSheetCloseVetoed(); CallableWithArgs<Void> getSheetClosed(); void setPreviewSheetClose(CallableWithArgs<Vote> previewSheetClose); void setSheetCloseVetoed(CallableWithArgs<Void> sheetCloseVetoed); void setSheetClosed(CallableWithArgs<Void> sheetClosed); org.apache.pivot.util.Vote previewSheetClose(org.apache.pivot.wtk.Sheet arg0, boolean arg1); void sheetCloseVetoed(org.apache.pivot.wtk.Sheet arg0, org.apache.pivot.util.Vote arg1); void sheetClosed(org.apache.pivot.wtk.Sheet arg0);  }### Answer:
@Test public void testPreviewSheetClose() { 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.getPreviewSheetClose()); adapter.previewSheetClose(null, false); assertFalse(invoked[0]); adapter.setPreviewSheetClose(callable); adapter.previewSheetClose(null, false); assertTrue(invoked[0]); }