refactor the flush method to have an _impl_ like the other methods and then add flush to the serialisation/deserialisation tests.
refactor the flush method to have an impl like the other methods and then add flush to the serialisation/deserialisation tests.