### Question:
IteratorHelper { @Nonnull public static <ELEMENTTYPE> IIterableIterator <ELEMENTTYPE> getIterator (@Nullable final Enumeration <? extends ELEMENTTYPE> aEnum) { return new IterableIteratorFromEnumeration <> (aEnum); } private  IteratorHelper(); static boolean isEmpty(@Nullable final Iterator <?> aIter); static boolean isEmpty(@Nullable final IIterableIterator <?> aIter); static boolean isEmpty(@Nullable final Enumeration <?> aEnum); static boolean isNotEmpty(@Nullable final Iterator <?> aIter); static boolean isNotEmpty(@Nullable final IIterableIterator <?> aIter); static boolean isNotEmpty(@Nullable final Enumeration <?> aEnum); @Nonnegative static int getSize(@Nullable final IIterableIterator <?> aIterator); @Nonnegative static int getSize(@Nullable final Iterator <?> aIterator); @Nonnegative static int getSize(@Nullable final Enumeration <?> aEnumeration); @Nonnull static IIterableIterator <ELEMENTTYPE> getIterator(@Nullable final Enumeration <? extends ELEMENTTYPE> aEnum); @Nonnull static Iterator <ELEMENTTYPE> getIterator(@Nullable final Iterable <ELEMENTTYPE> aCont); @Nonnull static Iterator <ELEMENTTYPE> getIterator(@Nullable final Iterator <ELEMENTTYPE> aIter); @Nonnull @SafeVarargs static Iterator <ELEMENTTYPE> getIterator(@Nullable final ELEMENTTYPE... aArray); @Nonnull static Iterator <ELEMENTTYPE> getReverseIterator(@Nullable final List <? extends ELEMENTTYPE> aCont); @Nonnull static Iterator <ELEMENTTYPE> getCombinedIterator(@Nullable final Iterator <? extends ELEMENTTYPE> aIter1,
                                                                          @Nullable final Iterator <? extends ELEMENTTYPE> aIter2); @Nonnull static Enumeration <ELEMENTTYPE> getEnumeration(@Nullable final Iterable <ELEMENTTYPE> aCont); @Nonnull @SafeVarargs static Enumeration <ELEMENTTYPE> getEnumeration(@Nullable final ELEMENTTYPE... aArray); @Nonnull static Enumeration <ELEMENTTYPE> getEnumeration(@Nullable final Iterator <ELEMENTTYPE> aIter); @Nonnull static Enumeration <Map.Entry <KEYTYPE, VALUETYPE>> getEnumeration(@Nullable final Map <KEYTYPE, VALUETYPE> aMap);  }### Answer:
@Test public void testGetIterator_Iterable () { assertNotNull (getIterator ((List <?>) null)); assertFalse (getIterator ((List <?>) null).hasNext ()); assertTrue (getIterator (newList ("abc")).hasNext ()); }
@Test public void testGetIterator_Iterator () { assertNotNull (getIterator ((Iterator <?>) null)); assertFalse (getIterator ((Iterator <?>) null).hasNext ()); assertTrue (getIterator (newList ("abc").iterator ()).hasNext ()); }
@Test public void testGetIterator_Array () { assertNotNull (getIterator (new String [0])); assertFalse (getIterator (new String [0]).hasNext ()); assertTrue (getIterator ("a").hasNext ()); }
@Test public void testGetIteratorFromEnumeration () { final Enumeration <String> aSourceEnum = Collections.enumeration (newList ("a", "b", "c", "d")); IIterableIterator <String> it = getIterator (aSourceEnum); assertNotNull (it); assertSame (it, it.iterator ()); assertTrue (it.hasNext ()); assertEquals ("a", it.next ()); assertTrue (it.hasNext ()); assertEquals ("b", it.next ()); assertTrue (it.hasNext ()); assertEquals ("c", it.next ()); assertTrue (it.hasNext ()); assertEquals ("d", it.next ()); assertFalse (it.hasNext ()); try { it.next (); fail (); } catch (final NoSuchElementException ex) {} try { it.remove (); fail (); } catch (final UnsupportedOperationException ex) {} it = getIterator ((Enumeration <String>) null); assertNotNull (it); assertFalse (it.hasNext ()); }