@Test
    public void deleteKeepsCorrectOrderLastEntry() {
        DynamicArray<Integer> arr = new DynamicArray();
        int[] expected = new int[10];
        for (int i = 0; i < 10; i++) {
            arr.insert(i);
            if (i < 9) {
                expected[i] = i;
            }
        }
        arr.delete(arr.getSize()-1);
        int[] actual = new int[10];
        for (int i = 0; i < arr.getSize(); i++) {
            actual[i] = arr.get(i);
        }
        assertArrayEquals(expected, actual);
    }