### Question:
A2 { public static Integer go(List<Integer> cases){ boolean pre = false; Integer result = null; int s = 0; int m = 2; int length = cases.size(); if (cases.get(0) > cases.get(1)) { result = cases.get(0); } else if (cases.get(length - 1) > cases.get(length - m)) { result = cases.get(length - 1); } else { for (int i = 1; i < length - 1; i++) { if (!pre) { if (cases.get(s) < cases.get(i)) { pre = true; } } else { if (cases.get(i) > cases.get(m)) { result = cases.get(i); break; } else if (cases.get(i).equals(cases.get(m))) { pre = false; } } m++; s++; } } return result; }  static Integer go(List<Integer> cases);  }### Answer:
@Test void go() { long starTime = System.currentTimeMillis(); for (int i = 0; i < cases.size(); i++) { Integer result = A2.go(Arrays.asList(cases.get(i))); assertTrue(Arrays.asList(results.get(i)).contains(result), "result=" + result + ",total=" + Arrays.toString(results.get(i))); } System.out.println("测试通过，花费时间：" + (System.currentTimeMillis() - starTime) + "ms"); }