This could be a guard statement: if (!present()) { throw exception } ...