@Test
public void testSgroupAtomListWrapping() throws Exception {

    IAtomContainer mol = TestMoleculeFactory.makeEthylPropylPhenantren();
    Sgroup sgroup = new Sgroup();
    for (IAtom atom : mol.atoms())
        sgroup.addAtom(atom);
    mol.setProperty(CDKConstants.CTAB_SGROUPS,
                    Collections.singletonList(sgroup));
    StringWriter sw = new StringWriter();
    try (MDLV2000Writer mdlw = new MDLV2000Writer(sw)) {
        mdlw.write(mol);
        String output = sw.toString();
        assertThat(output, containsString("M  SAL   1 15"));
        assertThat(output, containsString("M  SAL   1  4"));
    }
}