static AutoCloseable tempSetField(O o, S field, O value) { fO oldValue = get(o, field); set(o, field, value); ret () -> set(o, field, oldValue); } static AutoCloseable tempSetField(ISetAndGet gs, A value) { if (gs == null) null; // convenient null propagation as always in JavaX! A oldValue = gs!; gs.set(value); ret () -> gs.set(oldValue); } static AutoCloseable tempSetField(A value, ISetAndGet gs) { ret tempSetField(gs, value); }