Java, HashMap solution.
\nclass OrderedStream {\n\n    Map<Integer, String> store;\n    int lastIndex = 0;\n\n    public OrderedStream(int n) {\n        store = new HashMap<>(n);\n    
```\nclass OrderedStream {\n\n    Map<Integer, String> store;\n    int lastIndex = 0;\n\n    public OrderedStream(int n) {\n        store = new HashMap<>(n);\n    }\n\n    public List<String> insert(int idKey, String value) {\n        List<String> res = new ArrayList<>();\n        store.put(idKey, value);\n        while(store.containsKey(lastIndex+1)) {\n            res.add(store.get(++lastIndex));\n        }\n        return res;\n    }\n}\n```
['Java']