TPSReportStatusUsage { public void notifyDenied(TPSReportStatus status, final StatusNotifier notifier) { status._switch(new SwitchBlockWithDefault() { @Override public void _case(Denied x) { notifier.notifyDenied(); } @Override protected void _default(TPSReportStatus x) { } }); }  boolean isApproved(TPSReportStatus status); String message(TPSReportStatus status); void notify(TPSReportStatus status, final StatusNotifier notifier); void notifyDenied(TPSReportStatus status, final StatusNotifier notifier); boolean isApprovedV2(TPSReportStatus status);  }
@Test public void testNotifyDenid() { final Ref<String> result = new Ref<String>(); final StatusNotifier notifier = new StatusNotifier() { @Override public void notifyPending() { result.value = "pending"; } @Override public void notifyDenied() { result.value = "denied"; } @Override public void notifyApproved() { result.value = "approved"; } }; usage.notifyDenied(_Approved(_Manager("Fred")), notifier); assertNull(result.value); usage.notifyDenied(_Denied(_Manager("Fred")), notifier); assertEquals("denied", result.value); result.value = null; usage.notifyDenied(_Pending(), notifier); assertNull(result.value); }