The type of data
is Multimap
, not TreeMultimap
. Also, a NavigableMap<Integer, Collection<Integer>>
, is not compatible with NavigableMap<Integer, ArrayList<Integer>>
.
Change your code to:
TreeMultimap<Integer, Integer> data = TreeMultimap.create();
NavigableMap<Integer, Collection<Integer>> test = data.asMap();