David Hamelech (King David), when he was king of Israel, said to Hashem bechanani (test me). And Hashem said I will test you, but it's going to be an incredibly difficult test. The test in fact was in the area of arayos (illicit relations). The Navi (Prophets) tells us that David told his guard bring me eishes (the wife of) Uri Hachiti, bring me that woman. The guard said wait, she's a married woman. And David Hamelech lived with an eishes ish (married woman), with Batsheva.