Use Collection.size() to test how emptiness works, but use Collection.isEmpty() to make the code more readable and allow for better performance. The time complexity of any isEmpty() method execution should be O(1), while some implementations of scale() can be O\(N).
Compliant Solution
if (myCollection.isEmpty()) { // Compliant /* ... */ }