public static SelectionResult ensureSelectionResult(final Database db){
  List<SelectionResult> selections=ResultUtil.filterResults(db.getHierarchy(),db,SelectionResult.class);
  if (!selections.isEmpty()) {
    return selections.get(0);
  }
  SelectionResult sel=new SelectionResult();
  addChildResult(db,sel);
  return sel;
}

public static SelectionResult ensureSelectionResult ( final Database db ) { List < SelectionResult > selections = ResultUtil . filterResults ( db . getHierarchy ( ) , db , SelectionResult . class ) ; if ( ! selections . isEmpty ( ) ) { return selections . get ( 0 ) ; } SelectionResult sel = new SelectionResult ( ) ; addChildResult ( db , sel ) ; return sel ; }
ensure that there also is a selection container object .
