blob: 2f13010fbcd237f99afe567a82f9f2fed2e2714d [file] [log] [blame]
package com.siyeh.igtest.style.size_replaceable_by_is_empty;
import java.util.Collection;
public class SizeReplaceableByIsEmpty {
boolean foo(String s) {
return s.length() == 0;
}
boolean bas(StringBuilder b) {
return b.length() == 0;
}
boolean bar(Collection c) {
return c.size() == 0;
}
class String {
public int length() {
return 1;
}
public boolean isEmpty() {
return false;
}
}
abstract class MyList<T> implements java.util.List<T>
{
public boolean isEmpty()
{
return this.size() == 0;
}
}
}