@Test public void testCheckIfBInA() { List<String> bList = new ArrayList<String>(aList); bList.set(0, bList.get(0) + "_hello"); Assert.assertTrue(bList + " not all in " + aList, ListUtil.checkIfBInA(aList, bList, false) == false); Assert.assertTrue(bList + " not all in " + aList, ListUtil.checkIfBInA(aList, bList, true) == false); bList = new ArrayList<String>(aList); bList.set(0, bList.get(0).toUpperCase()); Assert.assertTrue(bList + " all in " + aList, ListUtil.checkIfBInA(aList, bList, false)); bList = new ArrayList<String>(aList); bList.set(0, bList.get(0).toUpperCase()); Assert.assertTrue(bList + " not all in " + aList, ListUtil.checkIfBInA(aList, bList, true) == false); }
public static boolean checkIfBInA(List<String> aList, List<String> bList, boolean caseSensitive) { if (null == aList || aList.isEmpty() || null == bList || bList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } try { makeSureBInA(aList, bList, caseSensitive); } catch (Exception e) { return false; } return true; }
ListUtil { public static boolean checkIfBInA(List<String> aList, List<String> bList, boolean caseSensitive) { if (null == aList || aList.isEmpty() || null == bList || bList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } try { makeSureBInA(aList, bList, caseSensitive); } catch (Exception e) { return false; } return true; } }
ListUtil { public static boolean checkIfBInA(List<String> aList, List<String> bList, boolean caseSensitive) { if (null == aList || aList.isEmpty() || null == bList || bList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } try { makeSureBInA(aList, bList, caseSensitive); } catch (Exception e) { return false; } return true; }  }
ListUtil { public static boolean checkIfBInA(List<String> aList, List<String> bList, boolean caseSensitive) { if (null == aList || aList.isEmpty() || null == bList || bList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } try { makeSureBInA(aList, bList, caseSensitive); } catch (Exception e) { return false; } return true; }  static boolean checkIfValueDuplicate(List<String> aList,
                                                boolean caseSensitive); static void makeSureNoValueDuplicate(List<String> aList,
                                                boolean caseSensitive); static boolean checkIfBInA(List<String> aList, List<String> bList,
                                      boolean caseSensitive); static void makeSureBInA(List<String> aList, List<String> bList,
                                    boolean caseSensitive); static boolean checkIfValueSame(List<Boolean> aList); static List<String> valueToLowerCase(List<String> aList); }
ListUtil { public static boolean checkIfBInA(List<String> aList, List<String> bList, boolean caseSensitive) { if (null == aList || aList.isEmpty() || null == bList || bList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } try { makeSureBInA(aList, bList, caseSensitive); } catch (Exception e) { return false; } return true; }  static boolean checkIfValueDuplicate(List<String> aList,
                                                boolean caseSensitive); static void makeSureNoValueDuplicate(List<String> aList,
                                                boolean caseSensitive); static boolean checkIfBInA(List<String> aList, List<String> bList,
                                      boolean caseSensitive); static void makeSureBInA(List<String> aList, List<String> bList,
                                    boolean caseSensitive); static boolean checkIfValueSame(List<Boolean> aList); static List<String> valueToLowerCase(List<String> aList);  }