Java Custom Exception Class Python Syntax If Statement