@Test public void testWithVisitor() { assertFalse(usage.isApproved(_Denied(_Manager("Foo")))); assertFalse(usage.isApproved(_Pending())); assertTrue(usage.isApproved(_Approved(_Manager("Foo")))); }
public boolean isApproved(TPSReportStatus status) { return status.match(new TPSReportStatus.MatchBlockWithDefault<Boolean>() { @Override public Boolean _case(Approved x) { return true; } @Override protected Boolean _default(TPSReportStatus x) { return false; } }); }
TPSReportStatusUsage { public boolean isApproved(TPSReportStatus status) { return status.match(new TPSReportStatus.MatchBlockWithDefault<Boolean>() { @Override public Boolean _case(Approved x) { return true; } @Override protected Boolean _default(TPSReportStatus x) { return false; } }); } }
TPSReportStatusUsage { public boolean isApproved(TPSReportStatus status) { return status.match(new TPSReportStatus.MatchBlockWithDefault<Boolean>() { @Override public Boolean _case(Approved x) { return true; } @Override protected Boolean _default(TPSReportStatus x) { return false; } }); }  }
TPSReportStatusUsage { public boolean isApproved(TPSReportStatus status) { return status.match(new TPSReportStatus.MatchBlockWithDefault<Boolean>() { @Override public Boolean _case(Approved x) { return true; } @Override protected Boolean _default(TPSReportStatus x) { return false; } }); }  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); }
TPSReportStatusUsage { public boolean isApproved(TPSReportStatus status) { return status.match(new TPSReportStatus.MatchBlockWithDefault<Boolean>() { @Override public Boolean _case(Approved x) { return true; } @Override protected Boolean _default(TPSReportStatus x) { return false; } }); }  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);  }