-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1510a12
commit bdd5277
Showing
5 changed files
with
55 additions
and
70 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
whatsmars-common/src/test/java/org/hongxi/java/util/collections/ArrayListTest.java
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
whatsmars-common/src/test/java/org/hongxi/java/util/collections/CollectionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.hongxi.java.util.collections; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* @author shenhongxi 2019/8/13 | ||
*/ | ||
public class CollectionsTest { | ||
|
||
@Test | ||
public void testArrayList() { | ||
ArrayList arrList = new ArrayList(); | ||
arrList.add(1); | ||
arrList.add(2); | ||
arrList.add(3); | ||
arrList.add(null); | ||
System.out.println(arrList); | ||
} | ||
|
||
@Test | ||
public void testLinkedList() { | ||
LinkedList<Integer> list = new LinkedList<>(); | ||
list.add(1); | ||
list.add(2); | ||
list.add(3); | ||
System.out.println(list); | ||
list.reverse(); | ||
System.out.println(list); | ||
} | ||
|
||
@Test | ||
public void testHashMap() { | ||
HashMap<Integer, String> map = new HashMap<>(); | ||
map.put(1, "first"); | ||
map.put(2, "second"); | ||
System.out.println(map.get(1)); | ||
System.out.println(map.size()); | ||
System.out.println(map.containsKey(1)); | ||
System.out.println(map.containsValue("first")); | ||
System.out.println(map.remove(1)); | ||
System.out.println(map.remove(2)); | ||
System.out.println(map.isEmpty()); | ||
} | ||
|
||
@Test | ||
public void testStack() { | ||
Stack<Integer> stack = new Stack<>(); | ||
stack.push(1); | ||
stack.push(2); | ||
stack.push(3); | ||
System.out.println(stack.pop()); | ||
System.out.println(stack.pop()); | ||
System.out.println(stack.pop()); | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
whatsmars-common/src/test/java/org/hongxi/java/util/collections/HashMapTest.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
whatsmars-common/src/test/java/org/hongxi/java/util/collections/LinkedListTest.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
whatsmars-common/src/test/java/org/hongxi/java/util/collections/StackTest.java
This file was deleted.
Oops, something went wrong.