import java.util.SortedMap;
import java.util.TreeMap;

class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        SortedMap<Integer, Integer> map = new TreeMap<Integer, Integer>();

        // Create incorrectly typed entry:
        ((SortedMap)map).put("hello", "world");

        // Map now contains Strings:
        System.out.println(map);

        // This would now cause an exception:
        //map.put(3, 4);
    }
}
