// Path: src/main/java/j8spec/J8Spec.java
// public static <T> Var<T> var() {
//     return new Var<>();
// }


import org.junit.Test;
import java.util.LinkedList;
import java.util.List;
import static j8spec.BlockExecutionFlag.FOCUSED;
import static j8spec.BlockExecutionFlag.IGNORED;
import static j8spec.BlockExecutionStrategy.BLACK_LIST;
import static j8spec.BlockExecutionStrategy.WHITE_LIST;
import static j8spec.UnsafeBlock.NOOP;
import static j8spec.J8Spec.var;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
                    .startGroup(groupConfig().description("describe A").executionFlag(FOCUSED).build())
                        .example(exampleConfig().description("block A1").build(), executed)
                        .example(exampleConfig().description("block A2").build(), executed)
                        .startGroup(groupConfig().description("describe A A").build())
                            .example(exampleConfig().description("block A A 1").build(), executed)
                            .example(exampleConfig().description("block A A 2").build(), executed)
                        .endGroup()
                    .endGroup()
                .endGroup()
        );

        verify(executed, times(4)).tryToExecute();
        verify(ignored, never()).tryToExecute();
    }

    @Test
    public void builds_examples_with_excepted_exception() {
        ExampleBuilder builder = new ExampleBuilder(BLACK_LIST);
        builder
            .startGroup(groupConfig().description("SampleSpec").definedOrder().build())
                .example(exampleConfig().description("block 1").expected(Exception.class).build(), NOOP)
            .endGroup();
        List<Example> examples = builder.build();

        assertThat(examples.get(0).expected(), is(equalTo(Exception.class)));
    }

    @Test
    public void initializes_variables_before_hooks() throws Throwable {
        final List<Object> values = new LinkedList<>();
// Path: src/main/java/j8spec/J8Spec.java
// public static <T> Var<T> var() {
//     return new Var<>();
// }


// Path: src/test/java/j8spec/ExampleBuilderTest.java
import org.junit.Test;
import java.util.LinkedList;
import java.util.List;
import static j8spec.BlockExecutionFlag.FOCUSED;
import static j8spec.BlockExecutionFlag.IGNORED;
import static j8spec.BlockExecutionStrategy.BLACK_LIST;
import static j8spec.BlockExecutionStrategy.WHITE_LIST;
import static j8spec.UnsafeBlock.NOOP;
import static j8spec.J8Spec.var;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

                    .startGroup(groupConfig().description("describe A").executionFlag(FOCUSED).build())
                        .example(exampleConfig().description("block A1").build(), executed)
                        .example(exampleConfig().description("block A2").build(), executed)
                        .startGroup(groupConfig().description("describe A A").build())
                            .example(exampleConfig().description("block A A 1").build(), executed)
                            .example(exampleConfig().description("block A A 2").build(), executed)
                        .endGroup()
                    .endGroup()
                .endGroup()
        );

        verify(executed, times(4)).tryToExecute();
        verify(ignored, never()).tryToExecute();
    }

    @Test
    public void builds_examples_with_excepted_exception() {
        ExampleBuilder builder = new ExampleBuilder(BLACK_LIST);
        builder
            .startGroup(groupConfig().description("SampleSpec").definedOrder().build())
                .example(exampleConfig().description("block 1").expected(Exception.class).build(), NOOP)
            .endGroup();
        List<Example> examples = builder.build();

        assertThat(examples.get(0).expected(), is(equalTo(Exception.class)));
    }

    @Test
    public void initializes_variables_before_hooks() throws Throwable {
        final List<Object> values = new LinkedList<>();
        final Var<String> v1 = var();