CompletionSubscriber is a Subscriber and offers a getCompletion method. It is expected to be returned from SubscriberBuilder.build. In addition, CompletionSubscriber has an of method to create an instance of it via composing it. The documentation also states
The best way to instantiate one of these is using the {@link CompletionSubscriber#of} factory method.
However, the SubscriberBuilderVerification.build() test expects the SubscriberBuilder.build() method to return an DefaultCompletionSubscriber effectively, not any arbitrary custom implementation of a CompletionSubscriber. The reason for this is that there is an equals assertion and there is no way to get to the DefaultCompletionSubscriber's wrapped Subscriber from the outside.
Essentially, in order to pass the TCK, implementors have to use CompletionSubscriber.of which makes having it as an interface pointless.
CompletionSubscriber
is aSubscriber
and offers agetCompletion
method. It is expected to be returned fromSubscriberBuilder.build
. In addition,CompletionSubscriber
has anof
method to create an instance of it via composing it. The documentation also statesHowever, the
SubscriberBuilderVerification.build()
test expects theSubscriberBuilder.build()
method to return anDefaultCompletionSubscriber
effectively, not any arbitrary custom implementation of aCompletionSubscriber
. The reason for this is that there is anequals
assertion and there is no way to get to theDefaultCompletionSubscriber
's wrappedSubscriber
from the outside.Essentially, in order to pass the TCK, implementors have to use
CompletionSubscriber.of
which makes having it as an interface pointless.