You can compare directly classes with o1.getClass()  != o2.getClass(). (Also, getCanonicalName() doesn't work in GWT)