@@ -0,0 +1,1880 @@
+// Copyright (C) 2014 The Android Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A// http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Aimport charter3.CircularlyLinkedList;%0Aimport charter3.CircularlyLinkedList2;%0Aimport charter3.MyRotateList;%0Aimport com.google.common.truth.Truth;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0A%0Aimport java.util.Arrays;%0A%0A@RunWith(Parameterized.class)%0Apublic class MyRotateListTest %7B%0A%0A    @Parameterized.Parameters(name = %22%7Bindex%7D: %7B0%7D%22)%0A    public static Iterable%3CMyRotateList%3E data() %7B%0A        return Arrays.asList(new MyRotateList%5B%5D%7Bnew CircularlyLinkedList(), new CircularlyLinkedList2()%7D);%0A    %7D%0A%0A    protected MyRotateList list;%0A%0A    public MyRotateListTest(MyRotateList list) %7B%0A        this.list = list;%0A    %7D%0A%0A    @Test(timeout = 90000L, expected = Test.None.class)%0A    public void testRotate() %7B%0A        list.add(%22head%22);%0A        list.addAfter(%22second%22, 0);%0A        list.appendToTheEnd(%22end%22);%0A        Truth.assertThat(list.get(0)).isEqualTo(%22head%22);%0A        Truth.assertThat(list.get(1)).isEqualTo(%22second%22);%0A        Truth.assertThat(list.get(2)).isEqualTo(%22end%22);%0A%0A        list.rotate();%0A        list.rotate();%0A        list.rotate();%0A        Truth.assertThat(list.get(0)).isEqualTo(%22head%22);%0A        Truth.assertThat(list.get(1)).isEqualTo(%22second%22);%0A        Truth.assertThat(list.get(2)).isEqualTo(%22end%22);%0A    %7D%0A%7D%0A

Add MyRotateListTest.java