SimpleSuccessDecider extends AbstractSuccessDecider { @Override public Efficiency getEfficency( Long[] run1, Long[] run2 ) { double radio = calculateRatio( run1, run2 ); if ( radio < payloadSuccessThreshold ) { return Efficiency.inefficient; } else if ( radio < 2 * payloadSuccessThreshold ) { return Efficiency.efficient; } else { return Efficiency.highlyEfficient; } }  @Override boolean wasSuccessful( Long[] run1, Long[] run2 ); @Override Efficiency getEfficency( Long[] run1, Long[] run2 );  }
@Test public void getEfficencyTest() { Long[] run1 = { 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l }; Long[] run2 = { 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l }; assertThat( simpleSuccessDecider.getEfficency( run1, run2 ), is( Efficiency.inefficient ) ); run2 = new Long[] { 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l }; assertThat( simpleSuccessDecider.getEfficency( run1, run2 ), is( Efficiency.efficient ) ); run2 = new Long[] { 8l, 8l, 8l, 8l, 8l, 8l, 8l, 8l, 8l, 8l }; assertThat( simpleSuccessDecider.getEfficency( run1, run2 ), is( Efficiency.highlyEfficient ) ); }