@@ -67,7 +67,7 @@ public static <T0, T1, T2, T3, R> Func1<Observer<R>, Subscription> zip(Observabl
67
67
@ SuppressWarnings ("unchecked" )
68
68
public static <R > Func1 <Observer <R >, Subscription > zip (Collection <Observable <?>> ws , FuncN <R > zipFunction ) {
69
69
Aggregator a = new Aggregator (zipFunction );
70
- for (Observable <?> w : ws ) {
70
+ for (Observable w : ws ) {
71
71
ZipObserver zipObserver = new ZipObserver (a , w );
72
72
a .addObserver (zipObserver );
73
73
}
@@ -281,6 +281,23 @@ private void stop() {
281
281
}
282
282
283
283
public static class UnitTest {
284
+
285
+ @ SuppressWarnings ("unchecked" )
286
+ @ Test
287
+ public void testCollectionSizeDifferentThanFunction () {
288
+ FuncN <String > zipr = Functions .from (getConcatStringIntegerIntArrayZipr ());
289
+
290
+ /* define a Observer to receive aggregated events */
291
+ Observer <String > aObserver = mock (Observer .class );
292
+
293
+ Collection ws = java .util .Collections .singleton (Observable .from ("one" , "two" ));
294
+ Observable <String > w = Observable .create (zip (ws , zipr ));
295
+ w .subscribe (aObserver );
296
+
297
+ verify (aObserver , times (1 )).onError (any (Exception .class ));
298
+ verify (aObserver , never ()).onCompleted ();
299
+ verify (aObserver , never ()).onNext (any (String .class ));
300
+ }
284
301
285
302
@ SuppressWarnings ("unchecked" )
286
303
/* mock calls don't do generics */
0 commit comments