Use nonEmpty instead of comparing to List.size

Lint issues