Add tests for duplicate()