Add test for ApplyDiff