private void extractSectionHeaders(List<Object> toc,
List<SectionHeader> resultList) {
for (Object tocItem : toc) {
if (tocItem instanceof SectionHeader) {
SectionHeader header = (SectionHeader) tocItem;
resultList.add(header);
} else {
@SuppressWarnings("unchecked")
final List<Object> list = (List<Object>) tocItem;
extractSectionHeaders(list, resultList);