If you think the Android project epgreader-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.jeffpalm.android.util;
//www.java2s.comimport java.util.Arrays;
import junit.framework.TestCase;
import com.jeffpalm.android.util.ShiftSet;
publicclass ShiftSetTest extends TestCase {
publicvoid testAddAll() {
ShiftSet<Integer> set = new ShiftSet<Integer>();
set.addAll(1, 2, 3, 1, 2, 3);
assertEquals(Arrays.asList(1, 2, 3), set.asList());
}
publicvoid testIsEmpty_true() {
ShiftSet<Integer> set = new ShiftSet<Integer>();
assertTrue(set.isEmpty());
}
publicvoid testIsEmpty_false() {
ShiftSet<Integer> set = new ShiftSet<Integer>(1, 2, 3);
assertFalse(set.isEmpty());
}
publicvoid testPeek_null() {
ShiftSet<Integer> set = new ShiftSet<Integer>();
assertNull(set.peek());
}
publicvoid testPeek() {
ShiftSet<Integer> set = new ShiftSet<Integer>(1, 2, 3);
assertEquals(Integer.valueOf(1), set.peek());
}
publicvoid testGetFirst() {
ShiftSet<Integer> set = new ShiftSet<Integer>(1, 2, 3);
assertEquals(Integer.valueOf(1), set.getFirst());
assertEquals(Integer.valueOf(2), set.getFirst());
assertEquals(Integer.valueOf(3), set.getFirst());
assertEquals(Integer.valueOf(1), set.getFirst());
assertEquals(Integer.valueOf(2), set.getFirst());
assertEquals(Integer.valueOf(3), set.getFirst());
}
publicvoid testGetLast() {
ShiftSet<Integer> set = new ShiftSet<Integer>(1, 2, 3);
assertEquals(Integer.valueOf(3), set.getLast());
assertEquals(Integer.valueOf(2), set.getLast());
assertEquals(Integer.valueOf(1), set.getLast());
assertEquals(Integer.valueOf(3), set.getLast());
assertEquals(Integer.valueOf(2), set.getLast());
assertEquals(Integer.valueOf(1), set.getLast());
}
}