There are multiple ways to get class of an object:
Instance Method:
boolean b = o instanceof Integer; // true or false
Equals Method:
boolean c = o.getClass().equals(Integer.class); // true or false
String Method:
String s = o.getClass().toString().substring("class ".length());
String class = s.substring(s.lastIndexOf(".") + 1);
And if any of the above does not work then you should check context initialization.
Generally, if you know you're going to need an int it is advisable to use int. Kawa will automatically cast/typecheck the value to the right type. If you really want to go this route, you'll actually need to test for multiple types. You'll need to test for Integer, which is the Java boxed type for int, and you'll need to check for gnu.math.IntNum, which is Kawa's native integer type. If you're also expect the result of math operations, such as 0.5 + 0.5, then you may also want to check for gnu.math.DFloNum since the result of said operation will be 1.0, which is technically an integer but stored as a double.