you could just return here !list.isEmpty() to save the branching :)