return function()local H=(game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).Packages.Monolith local b=require(H.ArrayStack)describe("\067\111\110\115\116\114\117\099\116\111\114",function()it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097\110 \101\109\112\116\121 \065\114\114\097\121\083\116\097\099\107",function()local H=b.new();(expect(H:Empty())).to.equal(true)end)it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097\110 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \097 \116\097\098\108\101",function()local H={1,2,3;4;5}local I=b.new(H);(expect(I:Count())).to.equal(#H)while I:Count()>0 do(expect(I:Pop())).to.equal(table.remove(H))end end)it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097\110 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \097 \067\111\108\108\101\099\116\105\111\110",function()local H=b.new({1;2,3,4;5})local I=b.new(H);(expect(I:Count())).to.equal(H:Count())while I:Count()>0 do local b=I:Pop()local e=H:Pop();(expect(b)).to.equal(e)end end)it("\115\104\111\117\108\100 \101\114\114\111\114 \119\104\101\110 \097\116\116\101\109\112\116\105\110\103 \116\111 \099\114\101\097\116\101 \097\110 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \097 \110\111\110-\116\097\098\108\101",function()(expect(function()b.new(true)end)).to.throw("\067\097\110\110\111\116 \099\111\110\115\116\114\117\099\116 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \116\121\112\101 \098\111\111\108\101\097\110\046");(expect(function()b.new(1)end)).to.throw("\067\097\110\110\111\116 \099\111\110\115\116\114\117\099\116 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \116\121\112\101 \110\117\109\098\101\114\046");(expect(function()b.new("\115\116\114\105\110\103")end)).to.throw("\067\097\110\110\111\116 \099\111\110\115\116\114\117\099\116 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \116\121\112\101 \115\116\114\105\110\103\046");(expect(function()b.new(function() end)end)).to.throw("\067\097\110\110\111\116 \099\111\110\115\116\114\117\099\116 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \116\121\112\101 \102\117\110\099\116\105\111\110\046");(expect(function()b.new(Instance.new("\070\111\108\100\101\114"))end)).to.throw("\067\097\110\110\111\116 \099\111\110\115\116\114\117\099\116 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \116\121\112\101 \117\115\101\114\100\097\116\097\046");(expect(function()b.new(coroutine.create(function() end))end)).to.throw("\067\097\110\110\111\116 \099\111\110\115\116\114\117\099\116 \065\114\114\097\121\083\116\097\099\107 \102\114\111\109 \116\121\112\101 \116\104\114\101\097\100\046")end)end)describe("\069\110\117\109\101\114\097\098\108\101 \073\110\116\101\114\102\097\099\101",function()describe("\069\110\117\109\101\114\097\116\111\114",function()it("\115\104\111\117\108\100 \112\114\111\118\105\100\101 \097\110 \105\116\101\114\097\116\111\114 \103\101\110\101\114\097\116\111\114",function()local H=b.new()local I=H:Enumerator();(expect(I)).to.be.a("\102\117\110\099\116\105\111\110")end)it("\115\104\111\117\108\100 \101\110\117\109\101\114\097\116\101 \105\110 \097 \103\101\110\101\114\105\099 \102\111\114 \108\111\111\112",function()local H=b.new()local I=10 for b=1,I,1 do H:Add(b)end local e=0 for H,b in H:Enumerator()do e=e+1;(expect(H)).to.be.a("\110\117\109\098\101\114");(expect(b)).to.be.a("\110\117\109\098\101\114")end;(expect(e)).to.equal(I)end)end)end)describe("\067\111\108\108\101\099\116\105\111\110 \073\110\116\101\114\102\097\099\101",function()describe("\082\101\113\117\105\114\101\100 \077\101\116\104\111\100\115",function()describe("\067\111\110\116\097\105\110\115",function()it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \097\110\121 \101\108\101\109\101\110\116 \119\104\101\110 \101\109\112\116\121",function()local H=b.new();(expect(H:Contains(0))).to.equal(false)end)it("\115\104\111\117\108\100 \102\105\110\100 \097\110 \101\108\101\109\101\110\116 \119\104\101\110 \116\104\097\116 \101\108\101\109\101\110\116 \101\120\105\115\116\115",function()local H=b.new({1;2;3;4,5});(expect(H:Contains(1))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \097\110 \101\108\101\109\101\110\116 \119\104\101\110 \116\104\097\116 \101\108\101\109\101\110\116 \100\111\101\115 \110\111\116 \101\120\105\115\116",function()local H=b.new({1;2,3,4;5});(expect(H:Contains(0))).to.equal(false)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \097\110 \101\108\101\109\101\110\116 \117\110\116\105\108 \105\116 \105\115 \097\100\100\101\100",function()local H=b.new({1;2;3;4,5});(expect(H:Contains(0))).to.equal(false)H:Add(0);(expect(H:Contains(0))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111 \108\111\110\103\101\114 \102\105\110\100 \097\110 \101\108\101\109\101\110\116 \119\104\101\110 \105\116\115 \114\101\109\111\118\101\100",function()local H=b.new({1;2,3,4,5});(expect(H:Contains(1))).to.equal(true)H:Remove(1);(expect(H:Contains(1))).to.equal(false)end)end)describe("\067\111\110\116\097\105\110\115\065\108\108",function()it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \097\110\121 \101\108\101\109\101\110\116 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()local I=b.new({1,2;3,4,5});(expect(H:ContainsAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \102\105\110\100 \097\108\108 \122\101\114\111 \101\108\101\109\101\110\116\115 \119\104\101\110 \116\104\101 \112\114\111\118\105\100\101\100 \067\111\108\108\101\099\116\105\111\110 \105\115 \101\109\112\116\121",function()local H=b.new({1;2;3,4,5})local I=b.new();(expect(H:ContainsAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \102\105\110\100 \097\108\108 \101\108\101\109\101\110\116\115 \119\104\101\110 \097\108\108 \111\102 \116\104\101 \101\108\101\109\101\110\116\115 \101\120\105\115\116",function()local H=b.new({1;2;3,4,5})local I=b.new({1,2,3,4,5});(expect(H:ContainsAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \102\105\110\100 \111\110\101 \101\108\101\109\101\110\116 \119\104\101\110 \105\116 \101\120\105\115\116\115",function()local H=b.new({1;2;3;4;5})local I=b.new({3});(expect(H:ContainsAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \097\108\108 \101\108\101\109\101\110\116\115 \119\104\101\110 \111\110\101 \100\111\101\115 \110\111\116 \101\120\105\115\116",function()local H=b.new({1,2,4;5})local I=b.new({1,2,3,4,5});(expect(H:ContainsAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \111\110\101 \101\108\101\109\101\110\116 \119\104\101\110 \105\116 \100\111\101\115 \110\111\116 \101\120\105\115\116",function()local H=b.new({1;2,4;5})local I=b.new({3});(expect(H:ContainsAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \097\108\108 \101\108\101\109\101\110\116\115 \117\110\116\105\108 \116\104\101\121 \097\114\101 \097\100\100\101\100",function()local H=b.new()local I=b.new({1;2});(expect(H:ContainsAll(I))).to.equal(false)H:Add(1);(expect(H:ContainsAll(I))).to.equal(false)H:Add(2);(expect(H:ContainsAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111 \108\111\110\103\101\114 \102\105\110\100 \097\108\108 \101\108\101\109\101\110\116\115 \119\104\101\110 \116\104\101\121 \097\114\101 \114\101\109\111\118\101\100",function()local H=b.new({1;2,3;4;5})local I=b.new({1;2,3,4,5});(expect(H:ContainsAll(I))).to.equal(true)H:Remove(1);(expect(H:ContainsAll(I))).to.equal(false)end)end)describe("\067\111\110\116\097\105\110\115\065\110\121",function()it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \097\110\121 \101\108\101\109\101\110\116 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()local I=b.new({1,2;3;4,5});(expect(H:ContainsAny(I))).to.equal(false)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \097\110\121 \101\108\101\109\101\110\116 \119\104\101\110 \116\104\101 \112\114\111\118\105\100\101\100 \067\111\108\108\101\099\116\105\111\110 \105\115 \101\109\112\116\121",function()local H=b.new({1,2,3,4,5})local I=b.new();(expect(H:ContainsAny(I))).to.equal(false)end)it("\115\104\111\117\108\100 \102\105\110\100 \097\108\108 \101\108\101\109\101\110\116\115 \119\104\101\110 \116\104\101 \101\108\101\109\101\110\116\115 \101\120\105\115\116",function()local H=b.new({1,2,3;4;5})local I=b.new({1,2,3;4,5});(expect(H:ContainsAny(I))).to.equal(true)end)it("\115\104\111\117\108\100 \102\105\110\100 \111\110\101 \101\108\101\109\101\110\116 \119\104\101\110 \105\116 \101\120\105\115\116\115",function()local H=b.new({1,2,3,4,5})local I=b.new({3});(expect(H:ContainsAny(I))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \115\111\109\101 \101\108\101\109\101\110\116\115 \119\104\101\110 \111\110\108\121 \111\110\101 \100\111\101\115 \110\111\116 \101\120\105\115\116",function()local H=b.new({1,2,4;5})local I=b.new({1,2,3,4,5});(expect(H:ContainsAny(I))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \111\110\101 \101\108\101\109\101\110\116 \119\104\101\110 \105\116 \100\111\101\115 \110\111\116 \101\120\105\115\116",function()local H=b.new({1;2,4;5})local I=b.new({3});(expect(H:ContainsAny(I))).to.equal(false)end)it("\115\104\111\117\108\100 \110\111\116 \102\105\110\100 \101\108\101\109\101\110\116\115 \117\110\116\105\108 \116\104\101\121 \097\114\101 \097\100\100\101\100",function()local H=b.new()local I=b.new({1;2});(expect(H:ContainsAny(I))).to.equal(false)H:Add(1);(expect(H:ContainsAny(I))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111 \108\111\110\103\101\114 \102\105\110\100 \097\108\108 \101\108\101\109\101\110\116\115 \119\104\101\110 \116\104\101\121 \097\114\101 \097\108\108 \114\101\109\111\118\101\100",function()local H=b.new({1;2;3,4;5})local I=b.new({1,2;3,4,5});(expect(H:ContainsAny(I))).to.equal(true)H:Remove(1);(expect(H:ContainsAny(I))).to.equal(true)H:Clear();(expect(H:ContainsAny(I))).to.equal(false)end)end)describe("\067\111\117\110\116",function()it("\115\104\111\117\108\100 \099\111\117\110\116 \122\101\114\111 \119\104\101\110 \101\109\112\116\121",function()local H=b.new();(expect(H:Count())).to.equal(0)end)it("\115\104\111\117\108\100 \099\111\117\110\116 \116\104\101 \110\117\109\098\101\114 \111\102 \101\108\101\109\101\110\116\115 \105\110 \116\104\101 \065\114\114\097\121\083\116\097\099\107",function()local H=b.new({1;2,3;4,5});(expect(H:Count())).to.equal(5)end)it("\115\104\111\117\108\100 \099\111\117\110\116 \110\101\119 \101\108\101\109\101\110\116\115 \097\115 \116\104\101\121 \097\114\101 \097\100\100\101\100",function()local H=b.new()local I=10;(expect(H:Count())).to.equal(0)for b=1,I,1 do H:Add(b);(expect(H:Count())).to.equal(b)end;(expect(H:Count())).to.equal(I)end)it("\115\104\111\117\108\100 \110\111\116 \099\111\117\110\116 \101\108\101\109\101\110\116\115 \097\102\116\101\114 \116\104\101\121 \097\114\101 \114\101\109\111\118\101\100",function()local H=b.new({1;2,3;4,5})local I=H:Count();(expect(I)).to.equal(5)while I>0 do H:Pop()local b=I I=H:Count();(expect(I)).to.equal(b-1)end end)it("\115\104\111\117\108\100 \099\111\117\110\116 \122\101\114\111 \097\102\116\101\114 \098\101\105\110\103 \099\108\101\097\114\101\100",function()local H=b.new({1;2,3,4,5});(expect(H:Count())).to.equal(5)H:Clear();(expect(H:Count())).to.equal(0)end)end)describe("\069\109\112\116\121",function()it("\115\104\111\117\108\100 \098\101 \101\109\112\116\121 \119\104\101\110 \105\110\115\116\097\110\116\105\097\116\101\100",function()local H=b.new();(expect(H:Empty())).to.equal(true)end)it("\115\104\111\117\108\100 \110\111\116 \098\101 \101\109\112\116\121 \119\105\116\104 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1});(expect(H:Empty())).to.equal(false)end)it("\115\104\111\117\108\100 \110\111\116 \098\101 \101\109\112\116\121 \119\105\116\104 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115",function()local H=b.new({1;2,3,4;5});(expect(H:Empty())).to.equal(false)end)it("\115\104\111\117\108\100 \110\111 \108\111\110\103\101\114 \098\101 \101\109\112\116\121 \097\102\116\101\114 \097\110 \101\108\101\109\101\110\116 \105\115 \097\100\100\101\100",function()local H=b.new();(expect(H:Empty())).to.equal(true)H:Add(1);(expect(H:Empty())).to.equal(false)end)it("\115\104\111\117\108\100 \098\101 \101\109\112\116\121 \097\102\116\101\114 \097\108\108 \101\108\101\109\101\110\116\115 \097\114\101 \114\101\109\111\118\101\100",function()local H=b.new({1,2;3;4,5})while H:Count()>0 do(expect(H:Empty())).to.equal(false)H:Pop()end;(expect(H:Empty())).to.equal(true)end)it("\115\104\111\117\108\100 \098\101 \101\109\112\116\121 \097\102\116\101\114 \098\101\105\110\103 \099\108\101\097\114\101\100",function()local H=b.new({1,2;3;4,5});(expect(H:Empty())).to.equal(false)H:Clear();(expect(H:Empty())).to.equal(true)end)end)describe("\084\111\065\114\114\097\121",function()it("\115\104\111\117\108\100 \114\101\116\117\114\110 \097 \116\097\098\108\101",function()local H=b.new();(expect(H:ToArray())).to.be.a("\116\097\098\108\101")end)it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097 \116\097\098\108\101 \111\102 \116\104\101 \115\097\109\101 \115\105\122\101",function()local H=b.new({1;2;3;4;5});(expect(#H:ToArray())).to.equal(H:Count())end)it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097\110 \101\109\112\116\121 \116\097\098\108\101 \119\104\101\110 \101\109\112\116\121",function()local H=b.new();(expect(#H:ToArray())).to.equal(0)end)it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097 \116\097\098\108\101 \119\105\116\104 \116\104\101 \115\097\109\101 \101\108\101\109\101\110\116\115 \097\110\100 \111\114\100\101\114 \111\102 \101\110\117\109\101\114\097\116\105\111\110",function()local H=b.new({1;2,3;4;5})local I=H:ToArray();(expect(#I)).to.equal(H:Count())while H:Count()>0 do(expect(H:Pop())).to.equal(table.remove(I))end;(expect(#I)).to.equal(0)end)it("\115\104\111\117\108\100 \112\114\111\118\105\100\101 \111\110\108\121 \097\114\114\097\121 \105\110\100\101\120\097\098\108\101 \101\108\101\109\101\110\116\115",function()local H=b.new({1,2,3;4;5})local I=H:ToArray()local e=0 for H in pairs(I)do e=e+1 end;(expect(e)).to.equal(#I)end)end)describe("\084\111\084\097\098\108\101",function()it("\115\104\111\117\108\100 \112\114\111\118\105\100\101 \116\104\101 \115\097\109\101 \114\101\112\114\101\115\101\110\116\097\116\105\111\110 \097\115 \084\111\065\114\114\097\121",function()local H=b.new({1,2,3,4;5})local I=H:ToArray()local e=H:ToTable();(expect(e)).to.be.a("\116\097\098\108\101");(expect(#e)).to.equal(#I)for H,b in pairs(e)do(expect(b)).to.equal(I[H])end end)end)end)describe("\079\112\116\105\111\110\097\108 \077\101\116\104\111\100\115",function()describe("\065\100\100",function()it("\115\104\111\117\108\100 \097\100\100 \101\108\101\109\101\110\116\115 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()H:Add(1);(expect(H:Count())).to.equal(1)end)it("\115\104\111\117\108\100 \097\100\100 \101\108\101\109\101\110\116\115 \119\104\101\110 \110\111\116 \101\109\112\116\121",function()local H=b.new({1;2;3,4;5})H:Add(6);(expect(H:Count())).to.equal(6)end)it("\115\104\111\117\108\100 \097\100\100 \101\108\101\109\101\110\116\115 \116\111 \116\104\101 \101\110\100",function()local H=b.new({1;2;3;4;5})H:Add(1);(expect(H:Last())).to.equal(1)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101",function()local H=b.new();(expect(H:Add(1))).to.equal(true)end)it("\115\104\111\117\108\100 \097\100\100 \100\117\112\108\105\099\097\116\101 \101\108\101\109\101\110\116\115",function()local H=b.new({1,1;1;1;1})H:Add(1);(expect(H:Count())).to.equal(6)end)end)describe("\065\100\100\065\108\108",function()it("\115\104\111\117\108\100 \097\100\100 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()local I=b.new({1;2;3;4,5})H:AddAll(I);(expect(H:Count())).to.equal(5)end)it("\115\104\111\117\108\100 \097\100\100 \111\110\101 \101\108\101\109\101\110\116 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()local I=b.new({1})H:AddAll(I);(expect(H:Count())).to.equal(1)end)it("\115\104\111\117\108\100 \097\100\100 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115 \119\104\101\110 \110\111\116 \101\109\112\116\121",function()local H=b.new({1;2,3;4,5})local I=b.new({6;7;8,9,0})H:AddAll(I);(expect(H:Count())).to.equal(10)end)it("\115\104\111\117\108\100 \097\100\100 \111\110\101 \101\108\101\109\101\110\116 \119\104\101\110 \110\111\116 \101\109\112\116\121",function()local H=b.new({1,2,3;4;5})local I=b.new({6})H:AddAll(I);(expect(H:Count())).to.equal(6)end)it("\115\104\111\117\108\100 \097\100\100 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115 \116\111 \116\104\101 \101\110\100",function()local H=b.new({1;2;3;4;5})local I=b.new({6;7;8,9,10})H:AddAll(I);(expect(H:Pop())).to.equal(10);(expect(H:Pop())).to.equal(9);(expect(H:Pop())).to.equal(8);(expect(H:Pop())).to.equal(7);(expect(H:Pop())).to.equal(6)end)it("\115\104\111\117\108\100 \097\100\100 \111\110\101 \101\108\101\109\101\110\116 \116\111 \116\104\101 \101\110\100",function()local H=b.new({1;2;3;4;5})local I=b.new({6})H:AddAll(I);(expect(H:Last())).to.equal(6)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \097\100\100\105\110\103 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115",function()local H=b.new()local I=b.new({6;7;8;9;10});(expect(H:AddAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \097\100\100\105\110\103 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new()local I=b.new({6});(expect(H:AddAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \097\100\100 \109\117\108\116\105\112\108\101 \100\117\112\108\105\099\097\116\101 \101\108\101\109\101\110\116\115",function()local H=b.new({1,1;1;1;1})local I=b.new({1;1;1,1,1})H:AddAll(I);(expect(H:Count())).to.equal(10)end)it("\115\104\111\117\108\100 \097\100\100 \111\110\101 \100\117\112\108\105\099\097\116\101 \101\108\101\109\101\110\116",function()local H=b.new({1,1,1;1,1})local I=b.new({1})H:AddAll(I);(expect(H:Count())).to.equal(6)end)end)describe("\067\108\101\097\114",function()it("\115\104\111\117\108\100 \099\108\101\097\114 \097\108\108 \101\108\101\109\101\110\116\115",function()local H=b.new({1,2,3,4,5});(expect(H:Empty())).to.equal(false)H:Clear();(expect(H:Empty())).to.equal(true)end)it("\115\104\111\117\108\100 \099\108\101\097\114 \119\104\101\110 \097\108\114\101\097\100\121 \101\109\112\116\121",function()local H=b.new()H:Clear();(expect(H:Empty())).to.equal(true)end)it("\115\104\111\117\108\100 \099\108\101\097\114 \119\105\116\104 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1})H:Clear();(expect(H:Empty())).to.equal(true)end)it("\115\104\111\117\108\100 \099\108\101\097\114 \119\105\116\104 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115",function()local H=b.new({1;2;3,4;5})H:Clear();(expect(H:Empty())).to.equal(true)end)it("\115\104\111\117\108\100 \099\108\101\097\114 \119\105\116\104 \100\117\112\108\105\099\097\116\101 \101\108\101\109\101\110\116\115",function()local H=b.new({1;1,1;1;1})H:Clear();(expect(H:Empty())).to.equal(true)end)end)describe("\082\101\109\111\118\101",function()it("\115\104\111\117\108\100 \115\117\099\099\101\115\115\102\117\108\108\121 \097\116\116\101\109\112\116 \116\111 \114\101\109\111\118\101 \119\104\101\110 \101\109\112\116\121",function()local H=b.new();(expect(function()H:Remove(1)end)).never.to.throw()end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \097\116\116\101\109\112\116\105\110\103 \116\111 \114\101\109\111\118\101 \119\104\101\110 \101\109\112\116\121",function()local H=b.new();(expect(H:Remove(1))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1})H:Remove(1);(expect(H:Count())).to.equal(0)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\109\111\118\105\110\103 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1});(expect(H:Remove(1))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \097\110 \101\108\101\109\101\110\116 \102\114\111\109 \109\097\110\121",function()local H=b.new({1,2;3;4;5})H:Remove(3);(expect(H:Count())).to.equal(4)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\109\111\118\105\110\103 \097\110 \101\108\101\109\101\110\116 \102\114\111\109 \109\097\110\121",function()local H=b.new({1,2,3,4;5});(expect(H:Remove(3))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111\116 \114\101\109\111\118\101 \119\104\101\110 \116\104\101 \101\108\101\109\101\110\116 \100\111\101\115 \110\111\116 \101\120\105\115\116",function()local H=b.new({1,2;3;4;5})H:Remove(6);(expect(H:Count())).to.equal(5)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \097\110 \101\108\101\109\101\110\116 \105\115\110\'\116 \114\101\109\111\118\101\100",function()local H=b.new({1;2;3;4;5});(expect(H:Remove(6))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \111\110\101 \101\108\101\109\101\110\116 \119\104\101\110 \116\104\101\114\101 \097\114\101 \100\117\112\108\105\099\097\116\101\115",function()local H=b.new({1;1;1,1,1})H:Remove(1);(expect(H:Count())).to.equal(4)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\109\111\118\105\110\103 \097 \100\117\112\108\105\099\097\116\101",function()local H=b.new({1;1,1,1,1});(expect(H:Remove(1))).to.equal(true)end)end)describe("\082\101\109\111\118\101\065\108\108",function()it("\115\104\111\117\108\100 \115\117\099\099\101\115\115\102\117\108\108\121 \097\116\116\101\109\112\116 \116\111 \114\101\109\111\118\101 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()local I=b.new({1;2;3;4;5});(expect(function()H:RemoveAll(I)end)).never.to.throw()end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \097\116\116\101\109\112\116\105\110\103 \116\111 \114\101\109\111\118\101 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()local I=b.new({1;2;3;4;5});(expect(H:RemoveAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1})local I=b.new({1})H:RemoveAll(I);(expect(H:Count())).to.equal(0)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\109\111\118\105\110\103 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1})local I=b.new({1});(expect(H:RemoveAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \119\105\116\104 \101\120\099\101\115\115 \101\108\101\109\101\110\116\115",function()local H=b.new({1})local I=b.new({1;2;3;4,5})H:RemoveAll(I);(expect(H:Count())).to.equal(0)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\109\111\118\105\110\103 \119\105\116\104 \101\120\099\101\115\115 \101\108\101\109\101\110\116\115",function()local H=b.new({1})local I=b.new({1;2,3;4,5});(expect(H:RemoveAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \111\110\101 \101\108\101\109\101\110\116 \102\114\111\109 \109\097\110\121",function()local H=b.new({1;2,3;4,5})local I=b.new({1})H:RemoveAll(I);(expect(H:Count())).to.equal(4)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\109\111\118\105\110\103 \111\110\101 \101\108\101\109\101\110\116 \102\114\111\109 \109\097\110\121",function()local H=b.new({1;2;3;4,5})local I=b.new({1});(expect(H:RemoveAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \110\111\116 \114\101\109\111\118\101 \119\104\101\110 \116\104\101 \101\108\101\109\101\110\116 \100\111\101\115 \110\111\116 \101\120\105\115\116",function()local H=b.new({1,2;3,4,5})local I=b.new({0})H:RemoveAll(I);(expect(H:Count())).to.equal(5)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \097\110 \101\108\101\109\101\110\116 \105\115\110\'\116 \114\101\109\111\118\101\100",function()local H=b.new({1;2;3;4,5})local I=b.new({0});(expect(H:RemoveAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115",function()local H=b.new({1;2,3,4,5})local I=b.new({1,2,3;4,5})H:RemoveAll(I);(expect(H:Count())).to.equal(0)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\109\111\118\105\110\103 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115",function()local H=b.new({1;2,3;4;5})local I=b.new({1;2,3;4;5});(expect(H:RemoveAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \111\110\108\121 \111\110\099\101 \102\111\114 \101\097\099\104 \111\099\099\117\114\114\101\110\099\101 \111\102 \100\117\112\108\105\099\097\116\101\115",function()local H=b.new({1;1,1,1;1})local I=b.new({1,1;1})H:RemoveAll(I);(expect(H:Count())).to.equal(2)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\109\111\118\105\110\103 \100\117\112\108\105\099\097\116\101\115",function()local H=b.new({1,1,1;1,1})local I=b.new({1;1,1});(expect(H:RemoveAll(I))).to.equal(true)end)end)describe("\082\101\116\097\105\110\065\108\108",function()it("\115\104\111\117\108\100 \115\117\099\099\101\115\115\102\117\108\108\121 \097\116\116\101\109\112\116 \116\111 \114\101\116\097\105\110 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()local I=b.new({1;2,3,4;5});(expect(function()H:RetainAll(I)end)).never.to.throw()end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \114\101\116\097\105\110\105\110\103 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()local I=b.new({1,2,3;4;5});(expect(H:RetainAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1})local I=b.new({1})H:RetainAll(I);(expect(H:Count())).to.equal(1)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \114\101\116\097\105\110\105\110\103 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1})local I=b.new({1});(expect(H:RetainAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \119\105\116\104 \101\120\099\101\115\115 \101\108\101\109\101\110\116\115 \116\111 \114\101\116\097\105\110",function()local H=b.new({1})local I=b.new({1,2,3;4;5})H:RetainAll(I);(expect(H:Count())).to.equal(1)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \114\101\116\097\105\110\105\110\103 \119\105\116\104 \101\120\099\101\115\115 \101\108\101\109\101\110\116\115 \116\111 \114\101\116\097\105\110",function()local H=b.new({1})local I=b.new({1;2;3,4;5});(expect(H:RetainAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \110\111\116 \114\101\116\097\105\110 \111\110\101 \101\108\101\109\101\110\116 \116\104\097\116 \100\111\101\115 \110\111\116 \109\097\116\099\104",function()local H=b.new({1})local I=b.new({0})H:RetainAll(I);(expect(H:Count())).to.equal(0)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \110\111\116 \114\101\116\097\105\110\105\110\103 \111\110\101 \101\108\101\109\101\110\116 \116\104\097\116 \100\111\101\115 \110\111\116 \109\097\116\099\104",function()local H=b.new({1})local I=b.new({0});(expect(H:RetainAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \111\110\101 \101\108\101\109\101\110\116 \102\114\111\109 \109\097\110\121",function()local H=b.new({1;2;3;4,5})local I=b.new({3})H:RetainAll(I);(expect(H:Count())).to.equal(1)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\116\097\105\110\105\110\103 \111\110\101 \101\108\101\109\101\110\116 \102\114\111\109 \109\097\110\121",function()local H=b.new({1,2;3;4,5})local I=b.new({3});(expect(H:RetainAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \110\111 \101\108\101\109\101\110\116\115 \119\104\101\110 \111\110\101 \101\108\101\109\101\110\116 \100\111\101\115 \110\111\116 \109\097\116\099\104",function()local H=b.new({1;2;3,4,5})local I=b.new({6})H:RetainAll(I);(expect(H:Count())).to.equal(0)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \110\111\116 \114\101\116\097\105\110\105\110\103 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1;2;3,4,5})local I=b.new({6});(expect(H:RetainAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115 \119\104\101\110 \109\111\114\101 \101\120\105\115\116",function()local H=b.new({1,2,3;4;5})local I=b.new({1;3,5})H:RetainAll(I);(expect(H:Count())).to.equal(3)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\116\097\105\110\105\110\103 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115 \119\104\101\110 \109\111\114\101 \101\120\105\115\116",function()local H=b.new({1;2;3;4,5})local I=b.new({1,3,5});(expect(H:RetainAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \109\117\108\116\105\112\108\101 \101\108\101\109\101\110\116\115 \119\104\101\110 \097\116\116\101\109\112\116\105\110\103 \116\111 \114\101\116\097\105\110 \101\120\099\101\115\115 \101\108\101\109\101\110\116\115",function()local H=b.new({1,2;3,4,5})local I=b.new({0;1,3})H:RetainAll(I);(expect(H:Count())).to.equal(2)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \097\116\116\101\109\112\105\110\103 \116\111 \114\101\116\097\105\110 \119\105\116\104 \101\120\099\101\115\115 \101\108\101\109\101\110\116\115",function()local H=b.new({1;2;3,4;5})local I=b.new({0;1,3});(expect(H:RetainAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \097\108\108 \101\108\101\109\101\110\116\115",function()local H=b.new({1,2;3,4,5})local I=b.new({1,2;3;4,5})H:RetainAll(I);(expect(H:Count())).to.equal(5)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \114\101\116\097\105\110\105\110\103 \097\108\108 \101\108\101\109\101\110\116\115",function()local H=b.new({1,2;3,4,5})local I=b.new({1,2;3,4;5});(expect(H:RetainAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \097\108\108 \101\108\101\109\101\110\116\115 \119\104\101\110 \097\116\116\101\109\112\116\105\110\103 \116\111 \114\101\116\097\105\110 \101\120\099\101\115\115",function()local H=b.new({1,2,3;4;5})local I=b.new({0,1;2,3,4;5})H:RetainAll(I);(expect(H:Count())).to.equal(5)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \097\116\116\101\109\112\116\105\110\103 \116\111 \114\101\116\097\105\110 \101\120\099\101\101\115\115 \097\110\100 \114\101\116\097\105\110\105\110\103 \097\108\108 \101\108\101\109\101\110\116\115",function()local H=b.new({1,2,3,4,5})local I=b.new({0,1,2,3;4;5});(expect(H:RetainAll(I))).to.equal(false)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \097\108\108 \100\117\112\108\105\099\097\116\101\115",function()local H=b.new({1;1;2,2;3})local I=b.new({1,2})H:RetainAll(I);(expect(H:Count())).to.equal(4)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101 \119\104\101\110 \114\101\116\097\105\110\105\110\103 \100\117\112\108\105\099\097\116\101\115 \097\110\100 \109\111\114\101 \101\120\105\115\116",function()local H=b.new({1,1,2,2,3})local I=b.new({1;2});(expect(H:RetainAll(I))).to.equal(true)end)it("\115\104\111\117\108\100 \114\101\116\097\105\110 \097\108\108 \100\117\112\108\105\099\097\116\101\115 \119\104\101\110 \097\116\116\101\109\112\105\110\103 \116\111 \114\101\116\097\105\110 \101\120\099\101\115\115",function()local H=b.new({1,1,1;1,1})local I=b.new({1,2})H:RetainAll(I);(expect(H:Count())).to.equal(5)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \102\097\108\115\101 \119\104\101\110 \114\101\116\097\105\110\105\110\103 \097\108\108 \100\117\112\108\105\099\097\116\101\115",function()local H=b.new({1,1;1,1;1})local I=b.new({1});(expect(H:RetainAll(I))).to.equal(false)end)end)end)end)describe("\083\116\097\099\107 \073\110\116\101\114\102\097\099\101",function()describe("\076\097\115\116",function()it("\115\104\111\117\108\100 \101\114\114\111\114 \119\104\101\110 \101\109\112\116\121",function()local H=b.new();(expect(function()H:Last()end)).to.throw("\078\111 \108\097\115\116 \101\108\101\109\101\110\116 \101\120\105\115\116\115\046")end)it("\115\104\111\117\108\100 \103\101\116 \116\104\101 \108\097\115\116 \101\108\101\109\101\110\116 \119\105\116\104 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1});(expect(H:Last())).to.equal(1)end)it("\115\104\111\117\108\100 \103\101\116 \116\104\101 \108\097\115\116 \101\108\101\109\101\110\116 \119\105\116\104 \109\097\110\121 \101\108\101\109\101\110\116\115",function()local H=b.new({1;2,3;4,5});(expect(H:Last())).to.equal(5)end)it("\115\104\111\117\108\100 \103\101\116 \116\104\101 \108\097\115\116 \101\108\101\109\101\110\116 \119\104\101\110 \101\108\101\109\101\110\116\115 \097\114\101 \114\101\109\111\118\101\100",function()local H=b.new({1,2,3,4,5})H:Pop();(expect(H:Last())).to.equal(4)end)it("\115\104\111\117\108\100 \101\114\114\111\114 \119\104\101\110 \097\108\108 \101\108\101\109\101\110\116\115 \104\097\118\101 \098\101\101\110 \114\101\109\111\118\101\100",function()local H=b.new({1;2;3,4;5})while H:Count()>0 do H:Pop()end;(expect(function()H:Last()end)).to.throw("\078\111 \108\097\115\116 \101\108\101\109\101\110\116 \101\120\105\115\116\115\046")end)end)describe("\080\117\115\104",function()it("\115\104\111\117\108\100 \097\100\100 \097\110 \105\116\101\109 \116\111 \116\104\101 \101\110\100 \119\104\101\110 \101\109\112\116\121",function()local H=b.new()H:Push(1);(expect(H:Last())).to.equal(1);(expect(H:Count())).to.equal(1)end)it("\115\104\111\117\108\100 \097\100\100 \097\110 \105\116\101\109 \116\111 \116\104\101 \101\110\100 \119\105\116\104 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1})H:Push(2);(expect(H:Count())).to.equal(2);(expect(H:Last())).to.equal(2)end)it("\115\104\111\117\108\100 \097\100\100 \097\110 \105\116\101\109 \116\111 \116\104\101 \101\110\100 \119\105\116\104 \109\097\110\121 \101\108\101\109\101\110\116\115",function()local H=b.new({1,2,3;4;5})H:Push(6);(expect(H:Count())).to.equal(6);(expect(H:Last())).to.equal(6)end)it("\115\104\111\117\108\100 \114\101\116\117\114\110 \116\114\117\101",function()local H=b.new({1;2,3;4;5});(expect(H:Push(6))).to.equal(true)end)end)describe("\080\111\112",function()it("\115\104\111\117\108\100 \101\114\114\111\114 \119\104\101\110 \101\109\112\116\121",function()local H=b.new();(expect(function()H:Pop()end)).to.throw("\078\111 \108\097\115\116 \101\108\101\109\101\110\116 \101\120\105\115\116\115\046")end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \097\110 \105\116\101\109 \102\114\111\109 \116\104\101 \101\110\100 \119\105\116\104 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1})H:Pop();(expect(H:Count())).to.equal(0)end)it("\115\104\111\117\108\100 \103\101\116 \116\104\101 \101\108\101\109\101\110\116 \119\104\101\110 \114\101\109\111\118\105\110\103 \119\105\116\104 \111\110\101 \101\108\101\109\101\110\116",function()local H=b.new({1});(expect(H:Pop())).to.equal(1)end)it("\115\104\111\117\108\100 \114\101\109\111\118\101 \097\110 \105\116\101\109 \102\114\111\109 \116\104\101 \101\110\100 \119\105\116\104 \109\097\110\121 \101\108\101\109\101\110\116\115",function()local H=b.new({1,2;3;4;5})H:Pop();(expect(H:Last())).to.equal(4);(expect(H:Count())).to.equal(4)end)it("\115\104\111\117\108\100 \103\101\116 \116\104\101 \101\108\101\109\101\110\116 \119\104\101\110 \114\101\109\111\118\105\110\103 \119\105\116\104 \109\097\110\121 \101\108\101\109\101\110\116\115",function()local H=b.new({1;2,3;4,5});(expect(H:Pop())).to.equal(5)end)end)end)end
--- Tests for the @{ArrayStack} class.

return function()
	local module = game:GetService("ReplicatedStorage").Packages.Monolith
	local ArrayStack = require(module.ArrayStack)

	describe("Constructor", function()
		it("should create an empty ArrayStack", function()
			local stack = ArrayStack.new()
			expect(stack:Empty()).to.equal(true)
		end)

		it("should create an ArrayStack from a table", function()
			local items = { 1, 2, 3, 4, 5 }
			local stack = ArrayStack.new(items)
			expect(stack:Count()).to.equal(#items)
			while stack:Count() > 0 do
				expect(stack:Pop()).to.equal(table.remove(items))
			end
		end)

		it("should create an ArrayStack from a Collection", function()
			local items = ArrayStack.new({ 1, 2, 3, 4, 5 })
			local stack = ArrayStack.new(items)
			expect(stack:Count()).to.equal(items:Count())
			while stack:Count() > 0 do
				local item = stack:Pop()
				local original = items:Pop()
				expect(item).to.equal(original)
			end
		end)

		it("should error when attempting to create an ArrayStack from a non-table", function()
			expect(function()
				ArrayStack.new(true)
			end).to.throw("Cannot construct ArrayStack from type boolean.")
			expect(function()
				ArrayStack.new(1)
			end).to.throw("Cannot construct ArrayStack from type number.")
			expect(function()
				ArrayStack.new("string")
			end).to.throw("Cannot construct ArrayStack from type string.")
			expect(function()
				ArrayStack.new(function() end)
			end).to.throw("Cannot construct ArrayStack from type function.")
			expect(function()
				ArrayStack.new(Instance.new("Folder"))
			end).to.throw("Cannot construct ArrayStack from type userdata.")
			expect(function()
				ArrayStack.new(coroutine.create(function() end))
			end).to.throw("Cannot construct ArrayStack from type thread.")
		end)
	end)

	describe("Enumerable Interface", function()
		describe("Enumerator", function()
			it("should provide an iterator generator", function()
				local stack = ArrayStack.new()
				local generator = stack:Enumerator()
				expect(generator).to.be.a("function")
			end)

			it("should enumerate in a generic for loop", function()
				local stack = ArrayStack.new()
				local total = 10
				for i = 1, total do
					stack:Add(i)
				end

				local count = 0
				for i, v in stack:Enumerator() do
					count = count + 1
					expect(i).to.be.a("number")
					expect(v).to.be.a("number")
				end

				expect(count).to.equal(total)
			end)
		end)
	end)

	describe("Collection Interface", function()
		describe("Required Methods", function()
			describe("Contains", function()
				it("should not find any element when empty", function()
					local stack = ArrayStack.new()
					expect(stack:Contains(0)).to.equal(false)
				end)

				it("should find an element when that element exists", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Contains(1)).to.equal(true)
				end)

				it("should not find an element when that element does not exist", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Contains(0)).to.equal(false)
				end)

				it("should not find an element until it is added", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Contains(0)).to.equal(false)
					stack:Add(0)
					expect(stack:Contains(0)).to.equal(true)
				end)

				it("should no longer find an element when its removed", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Contains(1)).to.equal(true)
					stack:Remove(1)
					expect(stack:Contains(1)).to.equal(false)
				end)
			end)

			describe("ContainsAll", function()
				it("should not find any element when empty", function()
					local stack = ArrayStack.new()
					local contained = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:ContainsAll(contained)).to.equal(false)
				end)

				it("should find all zero elements when the provided Collection is empty", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local contained = ArrayStack.new()
					expect(stack:ContainsAll(contained)).to.equal(true)
				end)

				it("should find all elements when all of the elements exist", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local contained = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:ContainsAll(contained)).to.equal(true)
				end)

				it("should find one element when it exists", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local contained = ArrayStack.new({ 3 })
					expect(stack:ContainsAll(contained)).to.equal(true)
				end)

				it("should not find all elements when one does not exist", function()
					local stack = ArrayStack.new({ 1, 2, 4, 5 })
					local contained = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:ContainsAll(contained)).to.equal(false)
				end)

				it("should not find one element when it does not exist", function()
					local stack = ArrayStack.new({ 1, 2, 4, 5 })
					local contained = ArrayStack.new({ 3 })
					expect(stack:ContainsAll(contained)).to.equal(false)
				end)

				it("should not find all elements until they are added", function()
					local stack = ArrayStack.new()
					local contained = ArrayStack.new({ 1, 2 })
					expect(stack:ContainsAll(contained)).to.equal(false)
					stack:Add(1)
					expect(stack:ContainsAll(contained)).to.equal(false)
					stack:Add(2)
					expect(stack:ContainsAll(contained)).to.equal(true)
				end)

				it("should no longer find all elements when they are removed", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local contained = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:ContainsAll(contained)).to.equal(true)
					stack:Remove(1)
					expect(stack:ContainsAll(contained)).to.equal(false)
				end)
			end)

			describe("ContainsAny", function()
				it("should not find any element when empty", function()
					local stack = ArrayStack.new()
					local contained = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:ContainsAny(contained)).to.equal(false)
				end)

				it("should not find any element when the provided Collection is empty", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local contained = ArrayStack.new()
					expect(stack:ContainsAny(contained)).to.equal(false)
				end)

				it("should find all elements when the elements exist", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local contained = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:ContainsAny(contained)).to.equal(true)
				end)

				it("should find one element when it exists", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local contained = ArrayStack.new({ 3 })
					expect(stack:ContainsAny(contained)).to.equal(true)
				end)

				it("should not find some elements when only one does not exist", function()
					local stack = ArrayStack.new({ 1, 2, 4, 5 })
					local contained = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:ContainsAny(contained)).to.equal(true)
				end)

				it("should not find one element when it does not exist", function()
					local stack = ArrayStack.new({ 1, 2, 4, 5 })
					local contained = ArrayStack.new({ 3 })
					expect(stack:ContainsAny(contained)).to.equal(false)
				end)

				it("should not find elements until they are added", function()
					local stack = ArrayStack.new()
					local contained = ArrayStack.new({ 1, 2 })
					expect(stack:ContainsAny(contained)).to.equal(false)
					stack:Add(1)
					expect(stack:ContainsAny(contained)).to.equal(true)
				end)

				it("should no longer find all elements when they are all removed", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local contained = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:ContainsAny(contained)).to.equal(true)
					stack:Remove(1)
					expect(stack:ContainsAny(contained)).to.equal(true)
					stack:Clear()
					expect(stack:ContainsAny(contained)).to.equal(false)
				end)
			end)

			describe("Count", function()
				it("should count zero when empty", function()
					local stack = ArrayStack.new()
					expect(stack:Count()).to.equal(0)
				end)

				it("should count the number of elements in the ArrayStack", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Count()).to.equal(5)
				end)

				it("should count new elements as they are added", function()
					local stack = ArrayStack.new()
					local total = 10
					expect(stack:Count()).to.equal(0)
					for i = 1, total do
						stack:Add(i)
						expect(stack:Count()).to.equal(i)
					end
					expect(stack:Count()).to.equal(total)
				end)

				it("should not count elements after they are removed", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local count = stack:Count()
					expect(count).to.equal(5)
					while count > 0 do
						stack:Pop()
						local oldCount = count
						count = stack:Count()
						expect(count).to.equal(oldCount - 1)
					end
				end)

				it("should count zero after being cleared", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Count()).to.equal(5)
					stack:Clear()
					expect(stack:Count()).to.equal(0)
				end)
			end)

			describe("Empty", function()
				it("should be empty when instantiated", function()
					local stack = ArrayStack.new()
					expect(stack:Empty()).to.equal(true)
				end)

				it("should not be empty with one element", function()
					local stack = ArrayStack.new({ 1 })
					expect(stack:Empty()).to.equal(false)
				end)

				it("should not be empty with multiple elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Empty()).to.equal(false)
				end)

				it("should no longer be empty after an element is added", function()
					local stack = ArrayStack.new()
					expect(stack:Empty()).to.equal(true)
					stack:Add(1)
					expect(stack:Empty()).to.equal(false)
				end)

				it("should be empty after all elements are removed", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					while stack:Count() > 0 do
						expect(stack:Empty()).to.equal(false)
						stack:Pop()
					end
					expect(stack:Empty()).to.equal(true)
				end)

				it("should be empty after being cleared", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Empty()).to.equal(false)
					stack:Clear()
					expect(stack:Empty()).to.equal(true)
				end)
			end)

			describe("ToArray", function()
				it("should return a table", function()
					local stack = ArrayStack.new()
					expect(stack:ToArray()).to.be.a("table")
				end)

				it("should create a table of the same size", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(#stack:ToArray()).to.equal(stack:Count())
				end)

				it("should create an empty table when empty", function()
					local stack = ArrayStack.new()
					expect(#stack:ToArray()).to.equal(0)
				end)

				it("should create a table with the same elements and order of enumeration", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local array = stack:ToArray()
					expect(#array).to.equal(stack:Count())
					while stack:Count() > 0 do
						expect(stack:Pop()).to.equal(table.remove(array))
					end
					expect(#array).to.equal(0)
				end)

				it("should provide only array indexable elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local array = stack:ToArray()
					local count = 0
					for _ in pairs(array) do
						count = count + 1
					end
					expect(count).to.equal(#array)
				end)
			end)

			describe("ToTable", function()
				it("should provide the same representation as ToArray", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local array = stack:ToArray()
					local table = stack:ToTable()
					expect(table).to.be.a("table")
					expect(#table).to.equal(#array)
					for i, v in pairs(table) do
						expect(v).to.equal(array[i])
					end
				end)
			end)
		end)

		describe("Optional Methods", function()
			describe("Add", function()
				it("should add elements when empty", function()
					local stack = ArrayStack.new()
					stack:Add(1)
					expect(stack:Count()).to.equal(1)
				end)

				it("should add elements when not empty", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:Add(6)
					expect(stack:Count()).to.equal(6)
				end)

				it("should add elements to the end", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:Add(1)
					expect(stack:Last()).to.equal(1)
				end)

				it("should return true", function()
					local stack = ArrayStack.new()
					expect(stack:Add(1)).to.equal(true)
				end)

				it("should add duplicate elements", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					stack:Add(1)
					expect(stack:Count()).to.equal(6)
				end)
			end)

			describe("AddAll", function()
				it("should add multiple elements when empty", function()
					local stack = ArrayStack.new()
					local add = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:AddAll(add)
					expect(stack:Count()).to.equal(5)
				end)

				it("should add one element when empty", function()
					local stack = ArrayStack.new()
					local add = ArrayStack.new({ 1 })
					stack:AddAll(add)
					expect(stack:Count()).to.equal(1)
				end)

				it("should add multiple elements when not empty", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local add = ArrayStack.new({ 6, 7, 8, 9, 0 })
					stack:AddAll(add)
					expect(stack:Count()).to.equal(10)
				end)

				it("should add one element when not empty", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local add = ArrayStack.new({ 6 })
					stack:AddAll(add)
					expect(stack:Count()).to.equal(6)
				end)

				it("should add multiple elements to the end", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local add = ArrayStack.new({ 6, 7, 8, 9, 10 })
					stack:AddAll(add)
					expect(stack:Pop()).to.equal(10)
					expect(stack:Pop()).to.equal(9)
					expect(stack:Pop()).to.equal(8)
					expect(stack:Pop()).to.equal(7)
					expect(stack:Pop()).to.equal(6)
				end)

				it("should add one element to the end", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local add = ArrayStack.new({ 6 })
					stack:AddAll(add)
					expect(stack:Last()).to.equal(6)
				end)

				it("should return true when adding multiple elements", function()
					local stack = ArrayStack.new()
					local add = ArrayStack.new({ 6, 7, 8, 9, 10 })
					expect(stack:AddAll(add)).to.equal(true)
				end)

				it("should return true when adding one element", function()
					local stack = ArrayStack.new()
					local add = ArrayStack.new({ 6 })
					expect(stack:AddAll(add)).to.equal(true)
				end)

				it("should add multiple duplicate elements", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					local add = ArrayStack.new({ 1, 1, 1, 1, 1 })
					stack:AddAll(add)
					expect(stack:Count()).to.equal(10)
				end)

				it("should add one duplicate element", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					local add = ArrayStack.new({ 1 })
					stack:AddAll(add)
					expect(stack:Count()).to.equal(6)
				end)
			end)

			describe("Clear", function()
				it("should clear all elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Empty()).to.equal(false)
					stack:Clear()
					expect(stack:Empty()).to.equal(true)
				end)

				it("should clear when already empty", function()
					local stack = ArrayStack.new()
					stack:Clear()
					expect(stack:Empty()).to.equal(true)
				end)

				it("should clear with one element", function()
					local stack = ArrayStack.new({ 1 })
					stack:Clear()
					expect(stack:Empty()).to.equal(true)
				end)

				it("should clear with multiple elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:Clear()
					expect(stack:Empty()).to.equal(true)
				end)

				it("should clear with duplicate elements", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					stack:Clear()
					expect(stack:Empty()).to.equal(true)
				end)
			end)

			describe("Remove", function()
				it("should successfully attempt to remove when empty", function()
					local stack = ArrayStack.new()
					expect(function()
						stack:Remove(1)
					end).never.to.throw()
				end)

				it("should return false when attempting to remove when empty", function()
					local stack = ArrayStack.new()
					expect(stack:Remove(1)).to.equal(false)
				end)

				it("should remove one element", function()
					local stack = ArrayStack.new({ 1 })
					stack:Remove(1)
					expect(stack:Count()).to.equal(0)
				end)

				it("should return true when removing one element", function()
					local stack = ArrayStack.new({ 1 })
					expect(stack:Remove(1)).to.equal(true)
				end)

				it("should remove an element from many", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:Remove(3)
					expect(stack:Count()).to.equal(4)
				end)

				it("should return true when removing an element from many", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Remove(3)).to.equal(true)
				end)

				it("should not remove when the element does not exist", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:Remove(6)
					expect(stack:Count()).to.equal(5)
				end)

				it("should return false when an element isn't removed", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:Remove(6)).to.equal(false)
				end)

				it("should remove one element when there are duplicates", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					stack:Remove(1)
					expect(stack:Count()).to.equal(4)
				end)

				it("should return true when removing a duplicate", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					expect(stack:Remove(1)).to.equal(true)
				end)
			end)

			describe("RemoveAll", function()
				it("should successfully attempt to remove when empty", function()
					local stack = ArrayStack.new()
					local remove = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(function()
						stack:RemoveAll(remove)
					end).never.to.throw()
				end)

				it("should return false when attempting to remove when empty", function()
					local stack = ArrayStack.new()
					local remove = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:RemoveAll(remove)).to.equal(false)
				end)

				it("should remove one element", function()
					local stack = ArrayStack.new({ 1 })
					local remove = ArrayStack.new({ 1 })
					stack:RemoveAll(remove)
					expect(stack:Count()).to.equal(0)
				end)

				it("should return true when removing one element", function()
					local stack = ArrayStack.new({ 1 })
					local remove = ArrayStack.new({ 1 })
					expect(stack:RemoveAll(remove)).to.equal(true)
				end)

				it("should remove with excess elements", function()
					local stack = ArrayStack.new({ 1 })
					local remove = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:RemoveAll(remove)
					expect(stack:Count()).to.equal(0)
				end)

				it("should return true when removing with excess elements", function()
					local stack = ArrayStack.new({ 1 })
					local remove = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:RemoveAll(remove)).to.equal(true)
				end)

				it("should remove one element from many", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local remove = ArrayStack.new({ 1 })
					stack:RemoveAll(remove)
					expect(stack:Count()).to.equal(4)
				end)

				it("should return true when removing one element from many", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local remove = ArrayStack.new({ 1 })
					expect(stack:RemoveAll(remove)).to.equal(true)
				end)

				it("should not remove when the element does not exist", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local remove = ArrayStack.new({ 0 })
					stack:RemoveAll(remove)
					expect(stack:Count()).to.equal(5)
				end)

				it("should return false when an element isn't removed", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local remove = ArrayStack.new({ 0 })
					expect(stack:RemoveAll(remove)).to.equal(false)
				end)

				it("should remove multiple elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local remove = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:RemoveAll(remove)
					expect(stack:Count()).to.equal(0)
				end)

				it("should return true when removing multiple elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local remove = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:RemoveAll(remove)).to.equal(true)
				end)

				it("should remove only once for each occurrence of duplicates", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					local remove = ArrayStack.new({ 1, 1, 1 })
					stack:RemoveAll(remove)
					expect(stack:Count()).to.equal(2)
				end)

				it("should return true when removing duplicates", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					local remove = ArrayStack.new({ 1, 1, 1 })
					expect(stack:RemoveAll(remove)).to.equal(true)
				end)
			end)

			describe("RetainAll", function()
				it("should successfully attempt to retain when empty", function()
					local stack = ArrayStack.new()
					local retain = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(function()
						stack:RetainAll(retain)
					end).never.to.throw()
				end)

				it("should return false when retaining when empty", function()
					local stack = ArrayStack.new()
					local retain = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:RetainAll(retain)).to.equal(false)
				end)

				it("should retain one element", function()
					local stack = ArrayStack.new({ 1 })
					local retain = ArrayStack.new({ 1 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(1)
				end)

				it("should return false when retaining one element", function()
					local stack = ArrayStack.new({ 1 })
					local retain = ArrayStack.new({ 1 })
					expect(stack:RetainAll(retain)).to.equal(false)
				end)

				it("should retain with excess elements to retain", function()
					local stack = ArrayStack.new({ 1 })
					local retain = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(1)
				end)

				it("should return false when retaining with excess elements to retain", function()
					local stack = ArrayStack.new({ 1 })
					local retain = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:RetainAll(retain)).to.equal(false)
				end)

				it("should not retain one element that does not match", function()
					local stack = ArrayStack.new({ 1 })
					local retain = ArrayStack.new({ 0 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(0)
				end)

				it("should return true when not retaining one element that does not match", function()
					local stack = ArrayStack.new({ 1 })
					local retain = ArrayStack.new({ 0 })
					expect(stack:RetainAll(retain)).to.equal(true)
				end)

				it("should retain one element from many", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 3 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(1)
				end)

				it("should return true when retaining one element from many", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 3 })
					expect(stack:RetainAll(retain)).to.equal(true)
				end)

				it("should retain no elements when one element does not match", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 6 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(0)
				end)

				it("should return true when not retaining one element", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 6 })
					expect(stack:RetainAll(retain)).to.equal(true)
				end)

				it("should retain multiple elements when more exist", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 1, 3, 5 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(3)
				end)

				it("should return true when retaining multiple elements when more exist", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 1, 3, 5 })
					expect(stack:RetainAll(retain)).to.equal(true)
				end)

				it("should retain multiple elements when attempting to retain excess elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 0, 1, 3 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(2)
				end)

				it("should return true when attemping to retain with excess elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 0, 1, 3 })
					expect(stack:RetainAll(retain)).to.equal(true)
				end)

				it("should retain all elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 1, 2, 3, 4, 5 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(5)
				end)

				it("should return false when retaining all elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 1, 2, 3, 4, 5 })
					expect(stack:RetainAll(retain)).to.equal(false)
				end)

				it("should retain all elements when attempting to retain excess", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 0, 1, 2, 3, 4, 5 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(5)
				end)

				it("should return false when attempting to retain exceess and retaining all elements", function()
					local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
					local retain = ArrayStack.new({ 0, 1, 2, 3, 4, 5 })
					expect(stack:RetainAll(retain)).to.equal(false)
				end)

				it("should retain all duplicates", function()
					local stack = ArrayStack.new({ 1, 1, 2, 2, 3 })
					local retain = ArrayStack.new({ 1, 2 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(4)
				end)

				it("should return true when retaining duplicates and more exist", function()
					local stack = ArrayStack.new({ 1, 1, 2, 2, 3 })
					local retain = ArrayStack.new({ 1, 2 })
					expect(stack:RetainAll(retain)).to.equal(true)
				end)

				it("should retain all duplicates when attemping to retain excess", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					local retain = ArrayStack.new({ 1, 2 })
					stack:RetainAll(retain)
					expect(stack:Count()).to.equal(5)
				end)

				it("should return false when retaining all duplicates", function()
					local stack = ArrayStack.new({ 1, 1, 1, 1, 1 })
					local retain = ArrayStack.new({ 1 })
					expect(stack:RetainAll(retain)).to.equal(false)
				end)
			end)
		end)
	end)

	describe("Stack Interface", function()
		describe("Last", function()
			it("should error when empty", function()
				local stack = ArrayStack.new()
				expect(function()
					stack:Last()
				end).to.throw("No last element exists.")
			end)

			it("should get the last element with one element", function()
				local stack = ArrayStack.new({ 1 })
				expect(stack:Last()).to.equal(1)
			end)

			it("should get the last element with many elements", function()
				local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
				expect(stack:Last()).to.equal(5)
			end)

			it("should get the last element when elements are removed", function()
				local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
				stack:Pop()
				expect(stack:Last()).to.equal(4)
			end)

			it("should error when all elements have been removed", function()
				local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
				while stack:Count() > 0 do
					stack:Pop()
				end
				expect(function()
					stack:Last()
				end).to.throw("No last element exists.")
			end)
		end)

		describe("Push", function()
			it("should add an item to the end when empty", function()
				local stack = ArrayStack.new()
				stack:Push(1)
				expect(stack:Last()).to.equal(1)
				expect(stack:Count()).to.equal(1)
			end)

			it("should add an item to the end with one element", function()
				local stack = ArrayStack.new({ 1 })
				stack:Push(2)
				expect(stack:Count()).to.equal(2)
				expect(stack:Last()).to.equal(2)
			end)

			it("should add an item to the end with many elements", function()
				local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
				stack:Push(6)
				expect(stack:Count()).to.equal(6)
				expect(stack:Last()).to.equal(6)
			end)

			it("should return true", function()
				local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
				expect(stack:Push(6)).to.equal(true)
			end)
		end)

		describe("Pop", function()
			it("should error when empty", function()
				local stack = ArrayStack.new()
				expect(function()
					stack:Pop()
				end).to.throw("No last element exists.")
			end)

			it("should remove an item from the end with one element", function()
				local stack = ArrayStack.new({ 1 })
				stack:Pop()
				expect(stack:Count()).to.equal(0)
			end)

			it("should get the element when removing with one element", function()
				local stack = ArrayStack.new({ 1 })
				expect(stack:Pop()).to.equal(1)
			end)

			it("should remove an item from the end with many elements", function()
				local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
				stack:Pop()
				expect(stack:Last()).to.equal(4)
				expect(stack:Count()).to.equal(4)
			end)

			it("should get the element when removing with many elements", function()
				local stack = ArrayStack.new({ 1, 2, 3, 4, 5 })
				expect(stack:Pop()).to.equal(5)
			end)
		end)
	end)
end
