java.math.BigInteger não pode ser convertido para java.lang.Integer

Estou recebendo a seguinte exceçã

Causado por

java.lang.ClassCastException: java.math.BigInteger não pode ser convertido em java.lang.Integer

com o seguinte código

List queryResult = query.list();

for (Iterator<Object[]> it = queryResult.iterator(); it.hasNext();) {
    Object[] result = it.next();
    Integer childId = (Integer) result[0];
    Integer grandChildCount = (Integer) result[1];
    CompanyNode childNode = childNodes.get(childId);
    childNode.setHasChildren(grandChildCount != 0);
    childNode.setIsLeaf(grandChildCount == 0);
}

nesta linha

Integer grandChildCount = (Integer) result[1];

Alguém tem alguma ideia

questionAnswers(10)

yourAnswerToTheQuestion