Test that a Platform Event was published?

My colleague suggested the following solution. Events can be stacked in static property and then checked in assert.

So trigger can be refactored like following

trigger CustomObject on CustomObject__c (after update) {
    CustomObjectService.publishEvent();
}

and method can be extracted into service class

public class CustomObjectService {
    @testVisible private static List<Platform_Event__e> eventList = new List<Platform_Event__e>();
    public static void publishEvent() {
        Platform_Event__e eve = new Platform_Event__e();
        eventList.add(eve);
        EventBus.publish(eve);
    }
}

and test for trigger can be rewritten in the following form

@isTest private class CustomObjectTriggerTest {
    static testMethod void testTrigger() {
        CustomObject__c rec = new CustomObject__c(Name = 'A');
        insert rec;
        Test.startTest();
            rec.Name = 'b';
            update rec;
        Test.stopTest();
        System.assert( 1, CustomObjectService.eventList.size(), 'There should be one element in the list' );
    }
}