I really admire java features and I don\'t want to give up using it for the next problem:
I have a class that might be inherited, and inside of it is a private Arr
private Arr
:) You have several options:
Don't expose getter, provide only methods which are allowed to call, e.g.
public void addToList(Object arg) { this.arr.add(arg);}
Return immutable object:
public List getArr() { return Collections.unmodifiableList(this.arr); }