### Question:
BlockUnblockFilter extends
		StateBasedBlockerFilter<BlockedUnblockedState> { public void block() { state(BlockedUnblockedState.BLOCK); } BlockUnblockFilter(BlockedUnblockedState initial); void block(); void unblock();  }### Answer:
@Test public void can_block_blocked() throws Exception { m_buf.block(); assertEquals(BlockedUnblockedState.BLOCK, m_buf.state()); m_buf.block(); assertEquals(BlockedUnblockedState.BLOCK, m_buf.state()); }
@Test public void blocked_events_are_rejected() throws Exception { m_buf.block(); m_buf.connect(m_sink); m_buf.sink(bus_data()); assertEquals(0, m_sink.m_data.size()); }
@Test public void obtaining_blocked_info() throws Exception { m_buf.block(); @SuppressWarnings("unchecked") StateBasedBlockerFilterInfo<BlockedUnblockedState> st = (StateBasedBlockerFilterInfo<BlockedUnblockedState>) m_buf.info(); assertEquals(BlockedUnblockedState.BLOCK, st.state()); }