Simplify testing with mock persistence contexts, by null checking in the AbstractServerTest.flush() method.