### Question:
TimedCounterList extends AbstractList<T> { public int count( T obj ) { int c = 0; m_lock.readLock().lock(); try { for( CounterItem< T > i : m_list ) { if( i.m_obj.equals( obj ) ) { c++; } } } finally { m_lock.readLock().unlock(); } return c; }  @Override T set( int index, T element ); @Override T get( int index ); @Override int size(); @Override void add( int index, T element ); @Override T remove( int index ); int count( T obj ); void cleanup( long maxage ); long getAddTime( int index );  }### Answer:
@Test public void testCount() { Assertions.assertEquals( 3, m_list.count( "Foo" ), "Foo" ); Assertions.assertEquals( 1, m_list.count( "Bar" ), "Bar" ); Assertions.assertEquals( 0, m_list.count( "Baz" ), "Baz" ); }