()
| 20 | private int[] positiveArraySorted; |
| 21 | |
| 22 | @Before |
| 23 | public void setUp() throws Exception { |
| 24 | // 生成随机数组 |
| 25 | array = randomArray(-1000, 1000, 100); |
| 26 | // 使用 Arrays.sort() 排序作为对比 |
| 27 | sortedArray = Arrays.copyOf(array, array.length); |
| 28 | Arrays.sort(sortedArray); |
| 29 | |
| 30 | positiveArray = randomArray(0, 1000, 100); |
| 31 | positiveArraySorted = Arrays.copyOf(positiveArray, positiveArray.length); |
| 32 | Arrays.sort(positiveArraySorted); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * 随机指定范围内N个不重复的数 |
nothing calls this directly
no test coverage detected