### Question:
Mainspring implements PowerSource { public Mainspring() { LOG.debug( "Spring created with {} milliseconds of energy.", energyLeftUntil - System.currentTimeMillis() ); } Mainspring(); void windSpring( long energyTime ); @Override boolean hasPower(); @Override void refill( final long energyTime );  }### Answer:
@Test public void testMainSpring() throws InterruptedException { Mainspring mainspring = new Mainspring(); assertTrue( mainspring.hasPower() ); while ( mainspring.hasPower() ) { Thread.sleep( 300L ); } assertFalse( mainspring.hasPower() ); mainspring.windSpring( 3000L ); assertTrue( mainspring.hasPower() ); }