This is the only way to call the new factory method `whenCompleted`.

Do you mean you want a test for constructing an anonymous class with an onCompleted method?