I would use isEmpty() for that check. It is more clear when code reading.