Util { public static <T> List<T> reverse(List<T> src) { List<T> copy = new ArrayList<T>(src); Collections.reverse(copy); return copy; } private  Util(); static List<T> reverse(List<T> src); @SuppressWarnings("unchecked") static T[] reverse(T[] array); static String expandUserHome(String text); static String fixBackslashesToSlashes(String path); static String fixSpacesToPercentTwenty(String path); static T ignoreAndReturnNull(); static void ignore(); static boolean isFeatureDisabled(Method method, DisableableFeature feature); static UnsupportedOperationException unsupported(Throwable cause, String msg, Object... args); static UnsupportedOperationException unsupported(String msg, Object... args); static T unreachableButCompilerNeedsThis(); static String asString(Object result); static long now(); static File fileFromURI(URI uri); static File fileFromURI(String uriSpec); static boolean eq(Object o1, Object o2); static SystemProvider system(); static void save(File target, Properties p); static void delete(File target); static void saveJar(File target, String entryName, Properties props); static T newInstance(Class<T> clazz); static List<T> newInstance(Class<? extends T>[] classes, List<T> result);  }
@Test public void testReverse() { Integer[] i = {1, 2, 3, 4, 5}; Integer[] result = Util.reverse(i); assertTrue(Arrays.equals(new Integer[] {1, 2, 3, 4, 5}, i)); assertTrue(Arrays.equals(new Integer[] {5, 4, 3, 2, 1}, result)); }