Factories are intended to be immutable, but the afterBuild and onCreate builder functions were mutating the factory instead of only adding these functions to the new factory that is returned.
This also fixes the test failure on master after merging #46.
Factories are intended to be immutable, but the afterBuild and onCreate builder functions were mutating the factory instead of only adding these functions to the new factory that is returned.
This also fixes the test failure on master after merging #46.