As proposed in SPR-7925.

The issue also proposes a noNullKeys(Map) and noNullValues(Map). If this makes sense I would also implement it with this or a separate PR.

Comment From: rweisleder

PMD complains about missing asserts in the new tests. I just copied existing tests. Is there a better way to check that no exception was raised or is it okay for these tests to leave them without assert?

Comment From: sbrannen

Superseded by work performed in conjunction with #23151.

See 4000b244ff7b1db1f4eba9c4dbf2fc97162da254.