public object GetObject(int id) { if(idToObject.Count <= id || id < 0) { throw new ArgumentOutOfRangeException("id"); } return idToObject[id]; }