@Test public void equals_and_hash_code() throws Exception { SaveSink ss = new SaveSink(); EventFilterChain c1 = new EventFilterChain(ss); EventFilterChain c2 = new EventFilterChain(ss); EventFilterChainInfo i1 = new EventFilterChainInfo(c1); EventFilterChainInfo i2 = new EventFilterChainInfo(c2); assertEquals(i1, i2); assertEquals(i1.hashCode(), i2.hashCode()); c1.add_filter(new TestEventFilter()); i1 = new EventFilterChainInfo(c1); assertFalse(i1.equals(i2)); assertNotSame(i1.hashCode(), i2.hashCode()); assertFalse(i1.equals(null)); assertFalse(i1.equals(new Integer(2))); assertTrue(i1.equals(i1)); }
public synchronized void add_filter(EventFilter f) { Ensure.not_null(f); Ensure.is_false(f.locked()); f.connect(first()); m_filters.add(f); f.lock(m_filters); }
EventFilterChain implements EventSink { public synchronized void add_filter(EventFilter f) { Ensure.not_null(f); Ensure.is_false(f.locked()); f.connect(first()); m_filters.add(f); f.lock(m_filters); } }
EventFilterChain implements EventSink { public synchronized void add_filter(EventFilter f) { Ensure.not_null(f); Ensure.is_false(f.locked()); f.connect(first()); m_filters.add(f); f.lock(m_filters); } EventFilterChain(EventSink sink); }
EventFilterChain implements EventSink { public synchronized void add_filter(EventFilter f) { Ensure.not_null(f); Ensure.is_false(f.locked()); f.connect(first()); m_filters.add(f); f.lock(m_filters); } EventFilterChain(EventSink sink); synchronized EventSink chain_sink(); synchronized List<EventFilter> filters(); synchronized void add_filter(EventFilter f); synchronized void remove_filter(EventFilter f); synchronized void clear(); @Override synchronized void sink(BusData data); synchronized EventFilterChainInfo info(); }
EventFilterChain implements EventSink { public synchronized void add_filter(EventFilter f) { Ensure.not_null(f); Ensure.is_false(f.locked()); f.connect(first()); m_filters.add(f); f.lock(m_filters); } EventFilterChain(EventSink sink); synchronized EventSink chain_sink(); synchronized List<EventFilter> filters(); synchronized void add_filter(EventFilter f); synchronized void remove_filter(EventFilter f); synchronized void clear(); @Override synchronized void sink(BusData data); synchronized EventFilterChainInfo info();  }