There's the AGG (Allgemeines Gleichbehandlungsgesetz) in Germany. It's enough to not include the feminine form of a job title or feminine pronouns in a job advertisement to sue the company after a rejection because of discrimination if you happen to be a woman. Instead of the gender, you can of course also assert the rejection was because of race, age, sexual orientation and so on.
(German legislation) I don't know the sources (probably many court rulings, not a law by itself), but I have heard that quite often: don't explain why a person was rejected, just say that you're sorry.