@Test
public void shouldHave1RootTestWith1BeforeAfterAnd1NestedTestWith2BeforeAnd2AfterCodes(){
SpecTree readSpec = parser.parse(BeforeAndAfterInheritedWhenNestedTest.class);
SpecTest onlyRootTest = readSpec.getRootGroup().getDeclaredTests().get(0);
assertThat(onlyRootTest.getName()).isEqualTo("test with 1 before/after set");
List<Runnable> rootBeforeBlocks = onlyRootTest.getBeforeBlocks();
assertThat(rootBeforeBlocks).hasSize(1);
List<Runnable> rootAfterBlocks = onlyRootTest.getAfterBlocks();
assertThat(rootAfterBlocks).hasSize(1);
SpecGroup onlyGroup = readSpec.getRootGroup().getSubGroups().get(0);
SpecTest nestedTest = onlyGroup.getDeclaredTests().get(0);
List<Runnable> nestedTestBeforeBlocks = nestedTest.getBeforeBlocks();
assertThat(nestedTestBeforeBlocks).hasSize(2);
assertThat(nestedTestBeforeBlocks.get(0)).isEqualTo(rootBeforeBlocks.get(0));
List<Runnable> nestedTestAfterBlocks = nestedTest.getAfterBlocks();
assertThat(nestedTestAfterBlocks).hasSize(2);
assertThat(nestedTestAfterBlocks.get(1)).isEqualTo(rootAfterBlocks.get(0));
}