implement setValue with duplicate values, and test it.