Java solution
\nclass OrderedStream {\n    \n    private int lo = 1;\n    private String[] vals;\n\n    public OrderedStream(int n) {\n        vals = new String[n+1];\n    }\
```\nclass OrderedStream {\n    \n    private int lo = 1;\n    private String[] vals;\n\n    public OrderedStream(int n) {\n        vals = new String[n+1];\n    }\n    \n    public List<String> insert(int idKey, String value) {\n        vals[idKey] = value;\n        \n        var retList = new ArrayList<String>();\n        while (lo < vals.length && vals[lo] != null) {\n            retList.add(vals[lo++]);\n        }\n        return retList;\n    }\n}\n```
['Java']