reactor-core/src/main/java/reactor/core/publisher/Operators.java
@SuppressWarnings("unchecked")
	public static <T> CorePublisher<T> onLastAssembly(CorePublisher<T> source) {
		Function<Publisher, Publisher> hook = Hooks.onLastOperatorHook;
		final Publisher<T> publisher;
		if (hook == null) {
			publisher = source;
		}
		else {
			publisher = Objects.requireNonNull(hook.apply(source),"LastOperator hook returned null");
		}

		if (publisher instanceof CorePublisher) {
			return (CorePublisher<T>) publisher;
		}
		else {
			return new CorePublisherAdapter<>(publisher);
		}
	}
@SuppressWarnings("unchecked")
	public static <T> CorePublisher<T> onLastAssembly(CorePublisher<T> source) {
		Function<Publisher, Publisher> hook = Hooks.onLastOperatorHook;
		final Publisher<T> publisher;
		if (hook == null) {
			publisher = source;
		}
		else {
			publisher = Objects.requireNonNull(hook.apply(source),"LastOperator hook returned null");
		}

		if (publisher instanceof CorePublisher) {
			return (CorePublisher<T>) publisher;
		}
		else {
			return new CorePublisherAdapter<>(publisher);
		}
	}
@ SuppressWarnings ( "unchecked" ) public static < T > CorePublisher < T > onLastAssembly ( CorePublisher < T > source ) { Function < Publisher , Publisher > hook = Hooks . onLastOperatorHook ; final Publisher < T > publisher ; if ( hook == null ) { publisher = source ; } else { publisher = Objects . requireNonNull ( hook . apply ( source ) , "LastOperator hook returned null" ) ; } if ( publisher instanceof CorePublisher ) { return ( CorePublisher < T > ) publisher ; } else { return new CorePublisherAdapter <> ( publisher ) ; } }
Applies the hooks registered with {@link Hooks#onLastOperator} and returns
{@link CorePublisher} ready to be subscribed on.

@param source the original {@link CorePublisher}.
@param <T> the type of the value.
@return a {@link CorePublisher} to subscribe on.
Applies the hooks registered with { @link Hooks#onLastOperator } and returns { @link CorePublisher } ready to be subscribed on .