Use isEmpty instead of comparing to List.size

Lint issue