mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add ArrayUtil.distict
This commit is contained in:
@@ -225,4 +225,11 @@ public class ArrayUtilTest {
|
||||
arrayType = ArrayUtil.getArrayType(String.class);
|
||||
Assert.assertEquals(String[].class, arrayType);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void distinctTest() {
|
||||
String[] array = {"aa", "bb", "cc", "dd", "bb", "dd"};
|
||||
String[] distinct = ArrayUtil.distinct(array);
|
||||
Assert.assertArrayEquals(new String[] {"aa", "bb", "cc", "dd"}, distinct);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user