changed signature of takeUntil to be more java friendly