Q: java.util.NoSuchElementException on java Map I just can't figure out what is the problem, why this code is throwing java.util.NoSuchElementException because there is hasNext before next method called
        Map results = getResults();
        if (results != null) 
        {

            Set set = results.entrySet();
            Iterator it = set.iterator();
            while (it.hasNext()) {
                Map.Entry entry = (Map.Entry) it.next();
                Iterator jt = ((Collection) entry.getValue()).iterator();
                while (jt.hasNext()) {
                    CustomException e = (CustomException) jt.next();
                    String exp = e.getMessage();
                    exp = (exp == null)?"":exp;
                    if(!"".equals(exp) && !exp.contains("errors"))
                    {
                        setError(exp)
                    }


                }
            }
        }

