if ((e instanceof AddEvent && m.getAdds().size() > 0) || (e instanceof RemoveEvent && m.getRemoves().size() > 0)) {
if ((e instanceof AddEvent && m.getAdds() != null) || (e instanceof RemoveEvent && m.getRemoves() != null)) {
    private void onPropertyEvent(final PropertyEvent e) {        final Object obj = e.getObject();        final Object arg = e.getArgument();        final ObjectMap om = e.getObjectMap();        Mapping m = om.getMapping(Path.get(e.getProperty().getName()));        if ((e instanceof AddEvent && m.getAdds().size() > 0) ||            (e instanceof RemoveEvent && m.getRemoves().size() > 0)) {            return;        }        final Role role = (Role) e.getProperty();        m.dispatch(new Mapping.Switch() {                public void onStatic(Static m) {                    // do nothing;                }                public void onValue(Value m) {                    Column col = m.getColumn();                    set(obj, col, arg);                }                public void onJoinTo(JoinTo m) {                    set(obj, m.getKey(), arg);                }                public void onJoinFrom(JoinFrom m) {                    set(arg, m.getKey(), obj);                }                public void onJoinThrough(JoinThrough m) {                    Column from = m.getFrom().getColumns()[0];                    Column to = m.getTo().getColumns()[0];                    Table table = from.getTable();                    DML op = m_engine.getOperation(obj, arg, table);                    // This should eliminate duplicates, but we could be                    // smarter by canceling out inserts and updates which                    // we don't do right now.                    if (op != null) { return; }                    boolean one2n = role.isReversable() &&                        !role.getReverse().isCollection();                    if (one2n) {                        op = m_engine.getOperation(arg, null, table);                    } else {                        op = m_engine.getOperation(arg, obj, table);                    }                    if (op != null) { return; }                    if (e instanceof AddEvent ||                        e instanceof SetEvent &&                        arg != null) {                        op = new Insert(table);                        set(op, m.getFrom(), obj);                        set(op, m.getTo(), arg);                        m_engine.addOperation(obj, arg, op);                    } else if (e instanceof RemoveEvent ||                               e instanceof SetEvent &&                               arg == null) {                        Delete del = new Delete(table, null);                        if (e instanceof SetEvent) {                            filter(del, m.getFrom(), KEY_FROM, obj);                        } else if (one2n) {                            filter(del, m.getTo(), KEY_TO, arg);                        } else {                            filter(del, m.getFrom(), KEY_FROM, obj);                            filter(del, m.getTo(), KEY_TO, arg);                        }                        if (one2n) {                            m_engine.addOperation(arg, null, del);                        } else {                            m_engine.addOperation(obj, arg, del);                        }                    } else {                        throw new IllegalArgumentException                            ("not a set, add, or remove");                    }                }            });    }