Migrating from 4.3 to 4.8, using CommandFactory.register

Hi, I’m currently on version 4.3 and I use CommandFactory.getInstance().register(new DropAllCommand())

When I upgrade to 4.8 this breaks because CommandFactory --> register was changed to protected when it used to be public.

How can I implement the same functionallity in version 4.8?