@Test public void testSplitOnNext() throws Exception { testWithOnNextOnError(new Action2<Action2, Action2>() { @Override public void call(Action2 onNext, Action2 onError) { new Delivery(1, Notification.createOnNext(2)).split(onNext, onError); verify(onNext, times(1)).call(1, 2); } }); }
public void split(Action2<View, T> onNext, @Nullable Action2<View, Throwable> onError) { if (notification.getKind() == Notification.Kind.OnNext) onNext.call(view, notification.getValue()); else if (onError != null && notification.getKind() == Notification.Kind.OnError) onError.call(view, notification.getThrowable()); }
Delivery { public void split(Action2<View, T> onNext, @Nullable Action2<View, Throwable> onError) { if (notification.getKind() == Notification.Kind.OnNext) onNext.call(view, notification.getValue()); else if (onError != null && notification.getKind() == Notification.Kind.OnError) onError.call(view, notification.getThrowable()); } }
Delivery { public void split(Action2<View, T> onNext, @Nullable Action2<View, Throwable> onError) { if (notification.getKind() == Notification.Kind.OnNext) onNext.call(view, notification.getValue()); else if (onError != null && notification.getKind() == Notification.Kind.OnError) onError.call(view, notification.getThrowable()); } Delivery(View view, Notification<T> notification); }
Delivery { public void split(Action2<View, T> onNext, @Nullable Action2<View, Throwable> onError) { if (notification.getKind() == Notification.Kind.OnNext) onNext.call(view, notification.getValue()); else if (onError != null && notification.getKind() == Notification.Kind.OnError) onError.call(view, notification.getThrowable()); } Delivery(View view, Notification<T> notification); void split(Action2<View, T> onNext, @Nullable Action2<View, Throwable> onError); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Delivery { public void split(Action2<View, T> onNext, @Nullable Action2<View, Throwable> onError) { if (notification.getKind() == Notification.Kind.OnNext) onNext.call(view, notification.getValue()); else if (onError != null && notification.getKind() == Notification.Kind.OnError) onError.call(view, notification.getThrowable()); } Delivery(View view, Notification<T> notification); void split(Action2<View, T> onNext, @Nullable Action2<View, Throwable> onError); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }