Section fooin = new BasicSection( fooname );
fooin.setContent( footext );
Section barin = new BasicSection( barname );
barin.setContent( bartext );
SectionSet foobarin = new SectionSet();
foobarin.addSection( fooin );
foobarin.addSection( barin );
Collapser collapser = new Collapser();
Section fooout = collapser.modify( fooin, mps );
assertTrue( fooout.getContent().equals( footextcollapse ) );
assertTrue( fooout.getName().equals( fooname ) );
collapser.modify( barin, mps );
assertTrue( barin.getContent().equals( bartextcollapse ) );
assertTrue( barin.getName().equals( barname ) );
fooin.setContent( footext );
barin.setContent( bartext );
SectionSet foobarout = collapser.modify( foobarin, mps );
Enumeration sectionEnum = foobarout.enumerateSections();
while( sectionEnum.hasMoreElements() ) {
Section section = (Section) sectionEnum.nextElement();
if( fooname.equals( section.getName() ) ) {
assertTrue( section.getContent().equals( footextcollapse ) );
}