public void testRobLebowitz() throws Exception {
  String text="<ul>" + "    <ul>" + "        <li/>"+ "            <ul>"+ "                <li/>"+ "            </ul>"+ "        <li/>"+ "    </ul>"+ "</ul>";
  Document document=DocumentHelper.parseText(text);
  List lists=document.selectNodes("//ul | //ol");
  int count=0;
  for (int i=0; i < lists.size(); i++) {
    Element list=(Element)lists.get(i);
    List nodes=list.selectNodes("ancestor::ul");
    if ((nodes != null) && (nodes.size() > 0)) {
      continue;
    }
    nodes=list.selectNodes("ancestor::ol");
    if ((nodes != null) && (nodes.size() > 0)) {
      continue;
    }
  }
}

public void testRobLebowitz ( ) throws Exception { String text = "<ul>" + "    <ul>" + "        <li/>" + "            <ul>" + "                <li/>" + "            </ul>" + "        <li/>" + "    </ul>" + "</ul>" ; Document document = DocumentHelper . parseText ( text ) ; List lists = document . selectNodes ( "//ul | //ol" ) ; int count = 0 ; for ( int i = 0 ; i < lists . size ( ) ; i ++ ) { Element list = ( Element ) lists . get ( i ) ; List nodes = list . selectNodes ( "ancestor::ul" ) ; if ( ( nodes != null ) && ( nodes . size ( ) > 0 ) ) { continue ; } nodes = list . selectNodes ( "ancestor::ol" ) ; if ( ( nodes != null ) && ( nodes . size ( ) > 0 ) ) { continue ; } } }
a bug found by rob lebowitz
