Thanks Paul. Really appreciate your comment. The problem is that I have no control over the objects that got sent to me. I have no way to modify those objects.
Here is an illustration:
The program may receive Java objects such as
String, Integer, Double, .., I like to classify, group and count those objects. In the end, I would like to know
x number of String objects
y number of Integer objects
z number of Double objects
further more, for "x number of String objects", I would like to know x1 number of String objects start with "a"; for y number of Integer objects, I like to find how many there are positive vs negative. ...
So, that is the problem I am facing.