Cita: Me ha dado el error java.lang.ClassCastException: java.math.BigDecimal.
....
int x = ((Integer) salida).intValue();
Del API: ClassCastException: Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance.
Pista: Querer que un objeto sea de una clase determinada no lo convierte en esa clase

.