@Test public void testCheckIfValueSame() { List<Boolean> boolList = new ArrayList<Boolean>(); boolList.add(true); boolList.add(true); boolList.add(true); Assert.assertTrue(boolList + " all value same.", ListUtil.checkIfValueSame(boolList)); boolList.add(false); Assert.assertTrue(boolList + "not all value same.", ListUtil.checkIfValueSame(boolList) == false); }
public static boolean checkIfValueSame(List<Boolean> aList) { if (null == aList || aList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } if (1 == aList.size()) { return true; } else { Boolean firstValue = aList.get(0); for (int i = 1, len = aList.size(); i < len; i++) { if (firstValue.booleanValue() != aList.get(i).booleanValue()) { return false; } } return true; } }
ListUtil { public static boolean checkIfValueSame(List<Boolean> aList) { if (null == aList || aList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } if (1 == aList.size()) { return true; } else { Boolean firstValue = aList.get(0); for (int i = 1, len = aList.size(); i < len; i++) { if (firstValue.booleanValue() != aList.get(i).booleanValue()) { return false; } } return true; } } }
ListUtil { public static boolean checkIfValueSame(List<Boolean> aList) { if (null == aList || aList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } if (1 == aList.size()) { return true; } else { Boolean firstValue = aList.get(0); for (int i = 1, len = aList.size(); i < len; i++) { if (firstValue.booleanValue() != aList.get(i).booleanValue()) { return false; } } return true; } }  }
ListUtil { public static boolean checkIfValueSame(List<Boolean> aList) { if (null == aList || aList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } if (1 == aList.size()) { return true; } else { Boolean firstValue = aList.get(0); for (int i = 1, len = aList.size(); i < len; i++) { if (firstValue.booleanValue() != aList.get(i).booleanValue()) { 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 checkIfValueSame(List<Boolean> aList) { if (null == aList || aList.isEmpty()) { throw new IllegalArgumentException("您提供的作业配置有误, List不能为空."); } if (1 == aList.size()) { return true; } else { Boolean firstValue = aList.get(0); for (int i = 1, len = aList.size(); i < len; i++) { if (firstValue.booleanValue() != aList.get(i).booleanValue()) { 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);  }