A check valve can prevent water hammer if it is fast-acting like a spring-actuated check valve. This prevents pressure surges, which create shock waves throughout the media.