@Test public void handler() { String file = path + "/text/EnglishWrite.txt"; List<String> lines = FileUtil.lines(new File(file)); CollectionHelper.handler(lines, new ObjectHandler<String>() { @Override public void handler(String line) { System.out.println("handler line:" + line); } }); }
public static <T> void handler(Collection<T> collection, ObjectHandler<T> handler) { if (collection == null || collection.size() == 0) { logger.error("collection is empty or is null"); return; } for (T t : collection) { handler.handler(t); } }
CollectionHelper { public static <T> void handler(Collection<T> collection, ObjectHandler<T> handler) { if (collection == null || collection.size() == 0) { logger.error("collection is empty or is null"); return; } for (T t : collection) { handler.handler(t); } } }
CollectionHelper { public static <T> void handler(Collection<T> collection, ObjectHandler<T> handler) { if (collection == null || collection.size() == 0) { logger.error("collection is empty or is null"); return; } for (T t : collection) { handler.handler(t); } }  }
CollectionHelper { public static <T> void handler(Collection<T> collection, ObjectHandler<T> handler) { if (collection == null || collection.size() == 0) { logger.error("collection is empty or is null"); return; } for (T t : collection) { handler.handler(t); } }  static void handler(Collection<T> collection, ObjectHandler<T> handler); static void process(Collection<T> collection, Collection<E> result, ObjectProcess<T, E> process); static List<T> removeDuplicate(List<T> list); static List<T> intersection(List<T> list1, List<T> list2); static Set<T> intersection(Set<T> set1, Set<T> set2); static Queue<T> intersection(Queue<T> queue1, Queue<T> queue2); static Map<K, V> intersection(Map<K, V> map1, Map<K, V> map2); static List<T> unicon(List<T> list1, List<T> list2); static Set<T> unicon(Set<T> set1, Set<T> set2); static Queue<T> unicon(Queue<T> queue1, Queue<T> queue2); static Map<K, V> unicon(Map<K, V> map1, Map<K, V> map2); static List<T> subtract(List<T> list1, List<T> list2); static Set<T> subtract(Set<T> set1, Set<T> set2); static Queue<T> subtract(Queue<T> queue1, Queue<T> queue2); static Map<K, V> subtract(Map<K, V> map1, Map<K, V> map2); static String join(Collection<T> collection, String separator); static String join(Map<K, V> map, String separator, String separator1); static String keyJoin(Map<K, V> map, String separator); static String valueJoin(Map<K, V> map, String separator); }
CollectionHelper { public static <T> void handler(Collection<T> collection, ObjectHandler<T> handler) { if (collection == null || collection.size() == 0) { logger.error("collection is empty or is null"); return; } for (T t : collection) { handler.handler(t); } }  static void handler(Collection<T> collection, ObjectHandler<T> handler); static void process(Collection<T> collection, Collection<E> result, ObjectProcess<T, E> process); static List<T> removeDuplicate(List<T> list); static List<T> intersection(List<T> list1, List<T> list2); static Set<T> intersection(Set<T> set1, Set<T> set2); static Queue<T> intersection(Queue<T> queue1, Queue<T> queue2); static Map<K, V> intersection(Map<K, V> map1, Map<K, V> map2); static List<T> unicon(List<T> list1, List<T> list2); static Set<T> unicon(Set<T> set1, Set<T> set2); static Queue<T> unicon(Queue<T> queue1, Queue<T> queue2); static Map<K, V> unicon(Map<K, V> map1, Map<K, V> map2); static List<T> subtract(List<T> list1, List<T> list2); static Set<T> subtract(Set<T> set1, Set<T> set2); static Queue<T> subtract(Queue<T> queue1, Queue<T> queue2); static Map<K, V> subtract(Map<K, V> map1, Map<K, V> map2); static String join(Collection<T> collection, String separator); static String join(Map<K, V> map, String separator, String separator1); static String keyJoin(Map<K, V> map, String separator); static String valueJoin(Map<K, V> map, String separator);  }