classList has class

JavaScript
List<Card> hand = ...;
for(Card card : hand){
  if (card instanceof AceOfDiamonds) return true;
}if (document.body.classList.contains('thatClass')) {
    // do some stuff
}
Source

Also in JavaScript: