Description
Replace this line https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/Cohort.java#L340
with getMemberships().isEmpty()
Background Information:
Using Collection.size() to test for emptiness works, but using Collection.isEmpty() makes the code more readable and can be more performant. The time complexity of any isEmpty() method implementation should be O(1) whereas some implementations of size() can be O\(n).