(String[] args)
| 48 | } |
| 49 | |
| 50 | public static void main(String[] args) { |
| 51 | for (int i = 0; i < 1000; i++) { |
| 52 | int size = AssortedMethods.randomIntInRange(5, 20); |
| 53 | int[] array = getDistinctSortedArray(size); |
| 54 | int v2 = magicFast(array); |
| 55 | if (v2 == -1 && magicSlow(array) != -1) { |
| 56 | int v1 = magicSlow(array); |
| 57 | System.out.println("Incorrect value: index = -1, actual = " + v1 + " " + i); |
| 58 | System.out.println(AssortedMethods.arrayToString(array)); |
| 59 | break; |
| 60 | } else if (v2 > -1 && array[v2] != v2) { |
| 61 | System.out.println("Incorrect values: index= " + v2 + ", value " + array[v2]); |
| 62 | System.out.println(AssortedMethods.arrayToString(array)); |
| 63 | break; |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | } |
nothing calls this directly
no test coverage detected