assertSame( mm.getChild( "child2" ), child2 );
}
@Test
public void testMetering() throws Exception {
Clock clock = createMock( Clock.class );
expect( clock.getUnit() ).andStubReturn( TimeUnit.MILLISECONDS );
expect( clock.getTime() ).andReturn( 0L ).once();
expect( clock.getTime() ).andReturn( 10L ).once();
expect( clock.getTime() ).andReturn( 100L ).once();
expect( clock.getTime() ).andReturn( 1000L ).times( 2 );
expect( clock.getTime() ).andReturn( 2000L ).times( 2 );
expect( clock.getTime() ).andReturn( 4000L ).times( 2 );
expect( clock.getTime() ).andReturn( 5000L ).times( 2 );
expect( clock.getTime() ).andReturn( 6000L ).times( 2 );
expect( clock.getTime() ).andReturn( 6500L ).times( 3 );
replay( clock );
BasicMeteringMetric mm = new BasicMeteringMetric( "foo" );
mm.setClock( clock );