@Test public void shouldConstructAtSpecifiedTitleNestingLevel() { builder = createInstanceWithNestingLevel2(); builder.title("My Title"); assertDocumentEquals("=== My Title"); }
@Override public CukedoctorDocumentBuilder title(String title) { switch (currentTitleNestingLevel) { case 0: documentTitle(title); break; case 1: sectionTitleLevel1(title); break; case 2: sectionTitleLevel2(title); break; case 3: sectionTitleLevel3(title); break; case 4: sectionTitleLevel4(title); break; case 5: sectionTitleLevel5(title); break; } return this; }
CukedoctorDocumentBuilderImpl extends AsciiDocBuilder implements CukedoctorDocumentBuilder { @Override public CukedoctorDocumentBuilder title(String title) { switch (currentTitleNestingLevel) { case 0: documentTitle(title); break; case 1: sectionTitleLevel1(title); break; case 2: sectionTitleLevel2(title); break; case 3: sectionTitleLevel3(title); break; case 4: sectionTitleLevel4(title); break; case 5: sectionTitleLevel5(title); break; } return this; } }
CukedoctorDocumentBuilderImpl extends AsciiDocBuilder implements CukedoctorDocumentBuilder { @Override public CukedoctorDocumentBuilder title(String title) { switch (currentTitleNestingLevel) { case 0: documentTitle(title); break; case 1: sectionTitleLevel1(title); break; case 2: sectionTitleLevel2(title); break; case 3: sectionTitleLevel3(title); break; case 4: sectionTitleLevel4(title); break; case 5: sectionTitleLevel5(title); break; } return this; } CukedoctorDocumentBuilderImpl(); private  CukedoctorDocumentBuilderImpl(int initialTitleNestingLevel); }
CukedoctorDocumentBuilderImpl extends AsciiDocBuilder implements CukedoctorDocumentBuilder { @Override public CukedoctorDocumentBuilder title(String title) { switch (currentTitleNestingLevel) { case 0: documentTitle(title); break; case 1: sectionTitleLevel1(title); break; case 2: sectionTitleLevel2(title); break; case 3: sectionTitleLevel3(title); break; case 4: sectionTitleLevel4(title); break; case 5: sectionTitleLevel5(title); break; } return this; } CukedoctorDocumentBuilderImpl(); private  CukedoctorDocumentBuilderImpl(int initialTitleNestingLevel); @Override AttributesBuilder attributes(); @Override CukedoctorDocumentBuilder sideBarBlock(String text); @Override CukedoctorDocumentBuilder append(Object... text); @Override CukedoctorDocumentBuilder textLine(String text); @Override CukedoctorDocumentBuilder sectionTitleLevel5(String title); @Override CukedoctorDocumentBuilder title(String title); @Override CukedoctorDocumentBuilder nestTitle(); CukedoctorDocumentBuilder unNestTitle(); @Override CukedoctorDocumentBuilder titleThenNest(String title); void clear(); @Override CukedoctorDocumentBuilder createNestedBuilder(); @Override CukedoctorDocumentBuilder createPeerBuilder(); }
CukedoctorDocumentBuilderImpl extends AsciiDocBuilder implements CukedoctorDocumentBuilder { @Override public CukedoctorDocumentBuilder title(String title) { switch (currentTitleNestingLevel) { case 0: documentTitle(title); break; case 1: sectionTitleLevel1(title); break; case 2: sectionTitleLevel2(title); break; case 3: sectionTitleLevel3(title); break; case 4: sectionTitleLevel4(title); break; case 5: sectionTitleLevel5(title); break; } return this; } CukedoctorDocumentBuilderImpl(); private  CukedoctorDocumentBuilderImpl(int initialTitleNestingLevel); @Override AttributesBuilder attributes(); @Override CukedoctorDocumentBuilder sideBarBlock(String text); @Override CukedoctorDocumentBuilder append(Object... text); @Override CukedoctorDocumentBuilder textLine(String text); @Override CukedoctorDocumentBuilder sectionTitleLevel5(String title); @Override CukedoctorDocumentBuilder title(String title); @Override CukedoctorDocumentBuilder nestTitle(); CukedoctorDocumentBuilder unNestTitle(); @Override CukedoctorDocumentBuilder titleThenNest(String title); void clear(); @Override CukedoctorDocumentBuilder createNestedBuilder(); @Override CukedoctorDocumentBuilder createPeerBuilder();  }