public PersistentObject assertOneEntry() throws EntryNotFoundException, UMSException {
  PersistentObject entry=null;
  while (hasMoreElements()) {
    entry=next();
    break;
  }
  if (entry == null) {
    throw new EntryNotFoundException();
  }
  if (hasMoreElements()) {
    abandon();
    throw new UMSException(i18n.getString(IUMSConstants.MULTIPLE_ENTRY));
  }
  return entry;
}

public PersistentObject assertOneEntry ( ) throws EntryNotFoundException , UMSException { PersistentObject entry = null ; while ( hasMoreElements ( ) ) { entry = next ( ) ; break ; } if ( entry == null ) { throw new EntryNotFoundException ( ) ; } if ( hasMoreElements ( ) ) { abandon ( ) ; throw new UMSException ( i18n . getString ( IUMSConstants . MULTIPLE_ENTRY ) ) ; } return entry ; }
assert if the search result contains one and only one entry .
