sclass VarWithNotify extends Var { event fireChange; // clever way (I hope) to do eq() outside of synchronization block public void set(A a) { A v = get(); if (eq(v, a)) ret; synchronized { v = a; } fireChange(); } }