Answer:
You can buy a "pipe hammer arrestor" at your local home improvement center. You will need two - one each for hot and cold. Basically, it is a piece of pipe that uses the air trapped in the pipe to absorb the shock when the valves close quickly.