@Test public void testGetArrayData() { int[] ints = new int[]{1, 2, 3, 4}; Assert.assertTrue(4 == CollectionUtils.get(ints, 7)); Assert.assertTrue(1 == CollectionUtils.get(ints, 0)); Assert.assertFalse(4 == CollectionUtils.get(ints, 1)); }
public static <T> T get(T[] data, int index) { int len = data.length; if (index > len - 1) { index = len - 1; } return data[index]; }
CollectionUtils { public static <T> T get(T[] data, int index) { int len = data.length; if (index > len - 1) { index = len - 1; } return data[index]; } }
CollectionUtils { public static <T> T get(T[] data, int index) { int len = data.length; if (index > len - 1) { index = len - 1; } return data[index]; }  }
CollectionUtils { public static <T> T get(T[] data, int index) { int len = data.length; if (index > len - 1) { index = len - 1; } return data[index]; }  static T last(List<T> data); static String strings(List<T> data, String split); static String strings(List<T> data); static T[] concat(T[] first, T[]... rest); static boolean isBlank(byte[] data); static boolean isBlank(List<T> data); static boolean isBlank(Map<K, V> data); static T get(T[] data, int index); static int get(int[] data, int index); static long get(long[] data, int index); static double get(double[] data, int index); static float get(float[] data, int index); }
CollectionUtils { public static <T> T get(T[] data, int index) { int len = data.length; if (index > len - 1) { index = len - 1; } return data[index]; }  static T last(List<T> data); static String strings(List<T> data, String split); static String strings(List<T> data); static T[] concat(T[] first, T[]... rest); static boolean isBlank(byte[] data); static boolean isBlank(List<T> data); static boolean isBlank(Map<K, V> data); static T get(T[] data, int index); static int get(int[] data, int index); static long get(long[] data, int index); static double get(double[] data, int index); static float get(float[] data, int index);  }