The following code is a pseudo code that denotes what I want to achieve:

```
Map<Class<?>, List<?>> map = Stream.of(1, "2").collect(Collectors.groupingBy(Object::getClass));
List<Integer> ints = map.get(Integer.class);
List<String> strings = map.get(String.class);

```

The above is a simplified code. What I want is I have an input list, I want to split it into multiple lists based on the class of the objects.

However the code above does not compile, I wonder how can you fix it?