// Path: core/src/main/java/com/github/jeluard/stone/consolidator/MaxConsolidator.java
// public final class MaxConsolidator extends BaseStreamingConsolidator {
// 
//   @Override
//   protected int initialValue() {
//     return Integer.MIN_VALUE;
//   }
// 
//   @Override
//   public void accumulate(final long timestamp, final int value) {
//     //Not atomic but not needed.
//     if (value > getCurrentResult()) {
//       setCurrentResult(value);
//     }
//   }
// 
// }
// 
// Path: core/src/main/java/com/github/jeluard/stone/consolidator/MinConsolidator.java
// public final class MinConsolidator extends BaseStreamingConsolidator {
// 
//   @Override
//   protected int initialValue() {
//     return Integer.MAX_VALUE;
//   }
// 
//   @Override
//   public void accumulate(final long timestamp, final int value) {
//     //Not atomic but not needed.
//     if (value < getCurrentResult()) {
//       setCurrentResult(value);
//     }
//   }
// 
// }
// 
// Path: core/src/main/java/com/github/jeluard/stone/helper/Loggers.java
// public final class Loggers {
// 
//   private Loggers() {
//   }
// 
//   private static final String BASE_LOGGER_NAME = "com.github.jeluard.stone";
//   public static final Logger BASE_LOGGER = Logger.getLogger(Loggers.BASE_LOGGER_NAME);
// 
//   /**
//    * @param suffix
//    * @return a configured {@link Logger}
//    */
//   public static Logger create(final String suffix) {
//     Preconditions.checkNotNull(suffix, "null suffix");
// 
//     return Logger.getLogger(Loggers.BASE_LOGGER_NAME+"."+suffix);
//   }
// 
// }


import com.github.jeluard.guayaba.test.AbstractTest;
import com.github.jeluard.guayaba.test.junit.LoggerRule;
import com.github.jeluard.stone.consolidator.MaxConsolidator;
import com.github.jeluard.stone.consolidator.MinConsolidator;
import com.github.jeluard.stone.helper.Loggers;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.Mockito;
  protected Class<Window> getType() {
    return Window.class;
  }

  @Override
  protected Window createInstance() throws Exception {
    return Window.of(WindowTest.DURATION_TWO).consolidatedBy(MaxConsolidator.class);
  }

  @Test(expected=IllegalArgumentException.class)
  public void shouldNegativeSizeBeInvalid() {
    Window.of(-1).consolidatedBy(MaxConsolidator.class);
  }

  @Test(expected=IllegalArgumentException.class)
  public void shouldTooSmallSizeBeInvalid() {
    Window.of(1).consolidatedBy(MaxConsolidator.class);
  }

  @Test
  public void shouldWindowBeCorrectlyCreated() {
    Assert.assertEquals(WindowTest.DURATION_TWO, Window.of(WindowTest.DURATION_TWO).consolidatedBy(MaxConsolidator.class).getSize());
    Assert.assertEquals(Collections.singletonList(MaxConsolidator.class), Window.of(WindowTest.DURATION_TWO).consolidatedBy(MaxConsolidator.class).getConsolidatorTypes());
  }

  @Test
  public void shouldListenerBeAccessibleIfProvided() {
    Assert.assertFalse (Window.of(WindowTest.DURATION_TWO).listenedBy(Mockito.mock(ConsolidationListener.class)).consolidatedBy(MaxConsolidator.class).getConsolidationListeners().isEmpty());
  }

// Path: core/src/main/java/com/github/jeluard/stone/consolidator/MaxConsolidator.java
// public final class MaxConsolidator extends BaseStreamingConsolidator {
// 
//   @Override
//   protected int initialValue() {
//     return Integer.MIN_VALUE;
//   }
// 
//   @Override
//   public void accumulate(final long timestamp, final int value) {
//     //Not atomic but not needed.
//     if (value > getCurrentResult()) {
//       setCurrentResult(value);
//     }
//   }
// 
// }
// 
// Path: core/src/main/java/com/github/jeluard/stone/consolidator/MinConsolidator.java
// public final class MinConsolidator extends BaseStreamingConsolidator {
// 
//   @Override
//   protected int initialValue() {
//     return Integer.MAX_VALUE;
//   }
// 
//   @Override
//   public void accumulate(final long timestamp, final int value) {
//     //Not atomic but not needed.
//     if (value < getCurrentResult()) {
//       setCurrentResult(value);
//     }
//   }
// 
// }
// 
// Path: core/src/main/java/com/github/jeluard/stone/helper/Loggers.java
// public final class Loggers {
// 
//   private Loggers() {
//   }
// 
//   private static final String BASE_LOGGER_NAME = "com.github.jeluard.stone";
//   public static final Logger BASE_LOGGER = Logger.getLogger(Loggers.BASE_LOGGER_NAME);
// 
//   /**
//    * @param suffix
//    * @return a configured {@link Logger}
//    */
//   public static Logger create(final String suffix) {
//     Preconditions.checkNotNull(suffix, "null suffix");
// 
//     return Logger.getLogger(Loggers.BASE_LOGGER_NAME+"."+suffix);
//   }
// 
// }


// Path: core/src/test/java/com/github/jeluard/stone/api/WindowTest.java
import com.github.jeluard.guayaba.test.AbstractTest;
import com.github.jeluard.guayaba.test.junit.LoggerRule;
import com.github.jeluard.stone.consolidator.MaxConsolidator;
import com.github.jeluard.stone.consolidator.MinConsolidator;
import com.github.jeluard.stone.helper.Loggers;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.Mockito;

  protected Class<Window> getType() {
    return Window.class;
  }

  @Override
  protected Window createInstance() throws Exception {
    return Window.of(WindowTest.DURATION_TWO).consolidatedBy(MaxConsolidator.class);
  }

  @Test(expected=IllegalArgumentException.class)
  public void shouldNegativeSizeBeInvalid() {
    Window.of(-1).consolidatedBy(MaxConsolidator.class);
  }

  @Test(expected=IllegalArgumentException.class)
  public void shouldTooSmallSizeBeInvalid() {
    Window.of(1).consolidatedBy(MaxConsolidator.class);
  }

  @Test
  public void shouldWindowBeCorrectlyCreated() {
    Assert.assertEquals(WindowTest.DURATION_TWO, Window.of(WindowTest.DURATION_TWO).consolidatedBy(MaxConsolidator.class).getSize());
    Assert.assertEquals(Collections.singletonList(MaxConsolidator.class), Window.of(WindowTest.DURATION_TWO).consolidatedBy(MaxConsolidator.class).getConsolidatorTypes());
  }

  @Test
  public void shouldListenerBeAccessibleIfProvided() {
    Assert.assertFalse (Window.of(WindowTest.DURATION_TWO).listenedBy(Mockito.mock(ConsolidationListener.class)).consolidatedBy(MaxConsolidator.class).getConsolidationListeners().isEmpty());
  }

  @Test