// Path: src/main/java/j8spec/J8Spec.java
// public static synchronized List<Example> read(Class<?> specClass) {
//     contexts.set(new ExampleGroupContext());
//     try {
//         ExampleGroupDefinition exampleGroupDefinition = newExampleGroupDefinition(specClass, contexts.get());
// 
//         exampleGroupDefinition.accept(new DuplicatedBlockValidator());
// 
//         BlockExecutionStrategySelector strategySelector = new BlockExecutionStrategySelector();
//         exampleGroupDefinition.accept(strategySelector);
// 
//         ExampleBuilder exampleBuilder = new ExampleBuilder(strategySelector.strategy());
//         exampleGroupDefinition.accept(exampleBuilder);
// 
//         return exampleBuilder.build();
//     } finally {
//         contexts.set(null);
//     }
// }
// 
// Path: src/main/java/j8spec/J8Spec.java
// public static synchronized void xcontext(String description, SafeBlock block) {
//     notAllowedWhenCIModeEnabled("xcontext");
//     isValidContext("xcontext");
//     ExampleGroupConfiguration config = new ExampleGroupConfiguration.Builder()
//         .description(description)
//         .executionFlag(IGNORED)
//         .build();
//     contexts.get().current().addGroup(config, block);
// }
// 
// Path: src/main/java/j8spec/J8Spec.java
// public static synchronized void xdescribe(String description, SafeBlock block) {
//     notAllowedWhenCIModeEnabled("xdescribe");
//     isValidContext("xdescribe");
//     ExampleGroupConfiguration config = new ExampleGroupConfiguration.Builder()
//         .description(description)
//         .executionFlag(IGNORED)
//         .build();
//     contexts.get().current().addGroup(config, block);
// }
// 
// Path: src/main/java/j8spec/J8Spec.java
// public static synchronized void xit(String description, UnsafeBlock block) {
//     xit(description, identity(), block);
// }


import org.junit.Test;
import static j8spec.J8Spec.read;
import static j8spec.J8Spec.xcontext;
import static j8spec.J8Spec.xdescribe;
import static j8spec.J8Spec.xit;
package j8spec;



public class J8SpecIgnoreTest {

    static class IgnoredExampleOverwrittenSpec {{
        xit("some text", UnsafeBlock.NOOP);
        xit("some text", UnsafeBlock.NOOP);
    }}

    static class IgnoredExampleWithCollectorOverwrittenSpec {{
        xit("some text", c -> c, UnsafeBlock.NOOP);
        xit("some text", UnsafeBlock.NOOP);
    }}

    @Test(expected = Exceptions.IllegalContext.class)
    public void does_not_allow_xdescribe_method_direct_invocation() {
        xdescribe("some text", SafeBlock.NOOP);
    }

    @Test(expected = Exceptions.IllegalContext.class)
    public void does_not_allow_xcontext_method_direct_invocation() {
        xcontext("some text", SafeBlock.NOOP);
    }

// Path: src/main/java/j8spec/J8Spec.java
// public static synchronized List<Example> read(Class<?> specClass) {
//     contexts.set(new ExampleGroupContext());
//     try {
//         ExampleGroupDefinition exampleGroupDefinition = newExampleGroupDefinition(specClass, contexts.get());
// 
//         exampleGroupDefinition.accept(new DuplicatedBlockValidator());
// 
//         BlockExecutionStrategySelector strategySelector = new BlockExecutionStrategySelector();
//         exampleGroupDefinition.accept(strategySelector);
// 
//         ExampleBuilder exampleBuilder = new ExampleBuilder(strategySelector.strategy());
//         exampleGroupDefinition.accept(exampleBuilder);
// 
//         return exampleBuilder.build();
//     } finally {
//         contexts.set(null);
//     }
// }
// 
// Path: src/main/java/j8spec/J8Spec.java
// public static synchronized void xcontext(String description, SafeBlock block) {
//     notAllowedWhenCIModeEnabled("xcontext");
//     isValidContext("xcontext");
//     ExampleGroupConfiguration config = new ExampleGroupConfiguration.Builder()
//         .description(description)
//         .executionFlag(IGNORED)
//         .build();
//     contexts.get().current().addGroup(config, block);
// }
// 
// Path: src/main/java/j8spec/J8Spec.java
// public static synchronized void xdescribe(String description, SafeBlock block) {
//     notAllowedWhenCIModeEnabled("xdescribe");
//     isValidContext("xdescribe");
//     ExampleGroupConfiguration config = new ExampleGroupConfiguration.Builder()
//         .description(description)
//         .executionFlag(IGNORED)
//         .build();
//     contexts.get().current().addGroup(config, block);
// }
// 
// Path: src/main/java/j8spec/J8Spec.java
// public static synchronized void xit(String description, UnsafeBlock block) {
//     xit(description, identity(), block);
// }


// Path: src/test/java/j8spec/J8SpecIgnoreTest.java
import org.junit.Test;
import static j8spec.J8Spec.read;
import static j8spec.J8Spec.xcontext;
import static j8spec.J8Spec.xdescribe;
import static j8spec.J8Spec.xit;

package j8spec;



public class J8SpecIgnoreTest {

    static class IgnoredExampleOverwrittenSpec {{
        xit("some text", UnsafeBlock.NOOP);
        xit("some text", UnsafeBlock.NOOP);
    }}

    static class IgnoredExampleWithCollectorOverwrittenSpec {{
        xit("some text", c -> c, UnsafeBlock.NOOP);
        xit("some text", UnsafeBlock.NOOP);
    }}

    @Test(expected = Exceptions.IllegalContext.class)
    public void does_not_allow_xdescribe_method_direct_invocation() {
        xdescribe("some text", SafeBlock.NOOP);
    }

    @Test(expected = Exceptions.IllegalContext.class)
    public void does_not_allow_xcontext_method_direct_invocation() {
        xcontext("some text", SafeBlock.NOOP);
    }

    @Test(expected = Exceptions.IllegalContext.class)