Added tests and documentation to #15716.