DefaultNamingEnumeration implements NamingEnumeration<NameClassPair> { @Override public NameClassPair next() throws NamingException { return nextElement(); } DefaultNamingEnumeration(Collection<NameClassPair> nameClassPairs); @Override void close(); @Override boolean hasMore(); @Override boolean hasMoreElements(); @Override NameClassPair next(); @Override NameClassPair nextElement();  }
@Test public void testNext() throws Exception { DefaultNamingEnumeration enumeration = new DefaultNamingEnumeration(new ArrayList<>()); assertThrows(NoSuchElementException.class, enumeration::next); }
@Test public void testNext2() throws Exception { NameClassPair pair = new NameClassPair("name", "className"); ArrayList<NameClassPair> list = new ArrayList<>(); list.add(pair); DefaultNamingEnumeration enumeration = new DefaultNamingEnumeration(list); assertNotNull(enumeration.next()); }