added method `isSameType` to compareobj. updated tests