@ SuppressWarnings ( { "unchecked" , "TypeParameterUnusedInFormals" } ) static < T extends Throwable > T getSneakyThrowable ( Throwable t ) throws T { throw ( T ) t ; }
Use this to throw checked exceptions from iterator methods that do not declare that they throw checked exceptions .