// Path: src/test/java/javafixes/test/Condition.java
// static <T extends Number> Condition<T> negative() {
//     return value -> signum(value) == -1;
// }
// 
// Path: src/test/java/javafixes/test/Condition.java
// static <T extends Number> Condition<T> positive() {
//     return value -> signum(value) == 1;
// }
// 
// Path: src/test/java/javafixes/test/Random.java
// public static boolean randomBoolean() {
//     return pickRandomValue(true, false);
// }
// 
// Path: src/test/java/javafixes/test/Random.java
// @SafeVarargs
// public static int randomInt(int from, int to, Function<Integer, Boolean>... validityConditions) {
//     return generateValidValue(
//             // typecast it to long as otherwise we could get int overflow
//             () -> (int) ((long) (Math.random() * ((long) to - (long) from + 1L)) + (long) from),
//             validityConditions
//     );
// }


import org.junit.Test;
import java.util.concurrent.ScheduledExecutorService;
import static java.util.concurrent.Executors.newScheduledThreadPool;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static javafixes.test.Condition.negative;
import static javafixes.test.Condition.positive;
import static javafixes.test.Random.randomBoolean;
import static javafixes.test.Random.randomInt;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
package javafixes.concurrency;




public class ReusableCountLatchTest {

    @Test
    public void shouldReflectInitialValue() {
        int positiveCount = randomInt(positive());

        assertThat(new ReusableCountLatch(positiveCount).getCount(), equalTo(positiveCount));
        assertThat(new ReusableCountLatch().getCount(), equalTo(0));
    }

    @Test
    public void shouldFailOnNegativeInitialCount() {
        try {
// Path: src/test/java/javafixes/test/Condition.java
// static <T extends Number> Condition<T> negative() {
//     return value -> signum(value) == -1;
// }
// 
// Path: src/test/java/javafixes/test/Condition.java
// static <T extends Number> Condition<T> positive() {
//     return value -> signum(value) == 1;
// }
// 
// Path: src/test/java/javafixes/test/Random.java
// public static boolean randomBoolean() {
//     return pickRandomValue(true, false);
// }
// 
// Path: src/test/java/javafixes/test/Random.java
// @SafeVarargs
// public static int randomInt(int from, int to, Function<Integer, Boolean>... validityConditions) {
//     return generateValidValue(
//             // typecast it to long as otherwise we could get int overflow
//             () -> (int) ((long) (Math.random() * ((long) to - (long) from + 1L)) + (long) from),
//             validityConditions
//     );
// }


// Path: src/test/java/javafixes/concurrency/ReusableCountLatchTest.java
import org.junit.Test;
import java.util.concurrent.ScheduledExecutorService;
import static java.util.concurrent.Executors.newScheduledThreadPool;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static javafixes.test.Condition.negative;
import static javafixes.test.Condition.positive;
import static javafixes.test.Random.randomBoolean;
import static javafixes.test.Random.randomInt;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

package javafixes.concurrency;




public class ReusableCountLatchTest {

    @Test
    public void shouldReflectInitialValue() {
        int positiveCount = randomInt(positive());

        assertThat(new ReusableCountLatch(positiveCount).getCount(), equalTo(positiveCount));
        assertThat(new ReusableCountLatch().getCount(), equalTo(0));
    }

    @Test
    public void shouldFailOnNegativeInitialCount() {
        try {
            int negativeCount = randomInt(negative());