Created
November 12, 2014 00:25
-
-
Save benhardy/85e4c3f3440a9cc44ea6 to your computer and use it in GitHub Desktop.
Gack.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> Iterable<T> asIterable(final Enumeration<T> anotherHorribleEnumeration) { | |
return () -> new Iterator<T>() { | |
@Override | |
public boolean hasNext() { | |
return anotherHorribleEnumeration.hasMoreElements(); | |
} | |
@Override | |
public T next() { | |
return anotherHorribleEnumeration.nextElement(); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment