[Java] Simple TreeSet solution
java\nclass NumberContainers {\n    private final Map<Integer, Integer> indexToNumber;\n    private final Map<Integer, TreeSet<Integer>> numberToIndexes;\n\n   
```java\nclass NumberContainers {\n    private final Map<Integer, Integer> indexToNumber;\n    private final Map<Integer, TreeSet<Integer>> numberToIndexes;\n\n    public NumberContainers() {\n        this.indexToNumber = new HashMap<>();\n        this.numberToIndexes = new HashMap<>();\n    }\n    \n    public void change(int index, int number) {\n        if(this.indexToNumber.containsKey(index)) {\n            final int n = this.indexToNumber.get(index);\n            final TreeSet<Integer> treeSet = this.numberToIndexes.get(n);\n\n            treeSet.remove(index);\n\n            if(treeSet.isEmpty())\n                this.numberToIndexes.remove(n);\n        }\n\n        this.indexToNumber.put(index, number);\n        this.numberToIndexes.putIfAbsent(number, new TreeSet<>());\n        this.numberToIndexes.get(number).add(index);\n    }\n    \n    public int find(int number) {\n        return this.numberToIndexes.containsKey(number) ? this.numberToIndexes.get(number).first() : -1;\n    }\n}\n\n/**\n * Your NumberContainers object will be instantiated and called as such:\n * NumberContainers obj = new NumberContainers();\n * obj.change(index,number);\n * int param_2 = obj.find(number);\n */\n```
['Java']