• + 4 comments
    Object element = it.next();
    if(element instanceof String)
    

    Try it its work 100%