class PubSub {

    public void unsubscribe(@NonNull Subscriber<T> sub) {
        synchronized (subs) {
            if (!subs.remove(sub)) {
                Log.e(TAG, "Unexpected listener unsubscribed");
            }
        }
    }

}