Look in the API specification for TreeMap, and see which way it is sorted.
In most maps, you have a key and a value, and you use the key for inserting and finding the values.
I presume by integer, you mean Integer.
Go to the API, which we should be reading all the time.
Find out whether Integer already has a compareTo<Integer>() method, and whether it implements the Comparable<Integer> interface.
Find out whether your TreeMap has to be sorted or is sorted automatically.
I think once you have found all that lot out, your answer to your query will be very easy. Then try it out and tell us what happens.
CR