Switch assert to IllegalArgumentException