void (Object from, Object to) { boolean editingStarted = from == null && to != null; boolean editingStopped = from != null && to == null; if (editingStarted) { activate(); } else if (editingStopped) { deactivate(); } }