package org.reactfx;

public interface Subscription {
    void unsubscribe();

    static final Subscription EMPTY = () -> {};

    static Subscription multi(Subscription... subscriptions) {
        return () -> {
            for(Subscription s: subscriptions) {
                s.unsubscribe();
            }
        };
    }
}

@@ -15,16 +15,37 @@
 actfx;%0A%0A
+@FunctionalInterface%0A
 public i
@@ -196,59 +196,396 @@
 subs
-criptions) %7B%0A        return () -%3E %7B%0A            for
+) %7B%0A        switch(subs.length) %7B%0A            case 0: return EMPTY;%0A            case 1: return subs%5B0%5D;%0A            case 2: return new BiSubscription(subs%5B0%5D, subs%5B1%5D);%0A            default: return new MultiSubscription(subs);%0A        %7D%0A    %7D%0A%7D%0A%0Aclass BiSubscription implements Subscription %7B%0A    private final Subscription s1;%0A    private final Subscription s2;%0A%0A    public BiSubscription
 (Sub
@@ -599,11 +599,12 @@
 on s
-: s
+1, S
 ubsc
@@ -610,17 +610,19 @@
 cription
-s
+ s2
 ) %7B%0A    
@@ -621,24 +621,481 @@
 ) %7B%0A        
+this.s1 = s1;%0A        this.s2 = s2;%0A    %7D%0A%0A    @Override%0A    public void unsubscribe() %7B%0A        s1.unsubscribe();%0A        s2.unsubscribe();%0A    %7D%0A%7D%0A%0Aclass MultiSubscription implements Subscription %7B%0A    private final Subscription%5B%5D subscriptions;%0A%0A    public MultiSubscription(Subscription... subscriptions) %7B%0A        this.subscriptions = subscriptions;%0A    %7D%0A%0A    @Override%0A    public void unsubscribe() %7B%0A        for(Subscription s: subscriptions) %7B%0A    
         s.un
@@ -1114,34 +1114,18 @@
 %0A   
-         %7D%0A        %7D;%0A
     
+ 
 %7D%0A
+    
 %7D%0A
+%7D

Add specialized implementation for bi-subscription