@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() ); }
public Mainspring() { LOG.debug( "Spring created with {} milliseconds of energy.", energyLeftUntil - System.currentTimeMillis() ); }
Mainspring implements PowerSource { public Mainspring() { LOG.debug( "Spring created with {} milliseconds of energy.", energyLeftUntil - System.currentTimeMillis() ); } }
Mainspring implements PowerSource { public Mainspring() { LOG.debug( "Spring created with {} milliseconds of energy.", energyLeftUntil - System.currentTimeMillis() ); } Mainspring(); }
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 ); }
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 );  }