Avoid using implementation types (i.e., HashSet); use the interface (i.e, Set) insteadimport java.util.*; public class Bar { // should be "private List list" private ArrayList list = new ArrayList(); // should be "public Set getFoo()" public HashSet getFoo() { return new HashSet(); } }Rationale: Helps reduce coupling on concrete classes. In addition abstract classes should be thought of a convenience base class implementations of interfaces and as such are not types themsleves.