Subsequent calls of NamingResult#hasMoreElements returns different values in some environments and situations. e.g. it occured on IBM JDK 7 with Windows Active Directory LDAP when the first value of 'hasMoreElements' was false. The first value is cached now.