code: public static SearchResult toSearchResult(NamingEnumeration<?> aNamingEnumeration)
     throws NoDataFoundException
     {
        if(aNamingEnumeration == null || !aNamingEnumeration.hasMoreElements())
           throw new NoDataFoundException("no results "+aNamingEnumeration);
        
        return (SearchResult)aNamingEnumeration.nextElement();
        
     }
docs: --------------------------------------------------------