Add test coverage and fix for duplication case when you have unsaved managed objects that are being POST'd to the server and should be mapped back. fixes #1228