### Question:
RequestDataConverter { public static double getHourDayRatio(List<Integer> listOfHours) { if (listOfHours.size() == 24) { return 1; } double result = 0d; for (Integer i : listOfHours) { result = result + TRAFFIC_ARRAY.get(i); } return result / 100; } private  RequestDataConverter(); static String getRegionByCityCode(String cityCode); static String getRegionByCityName(String cityName); static String getCityCodeByCityName(String cityName); static Double getRegionRatioByCityCode(String cityCode); static Map<String, Double> getRegionRatioMap(TargetingChannel targetingChannel); static double getHourDayRatio(List<Integer> listOfHours); static Map<Double, List<String>> buildRatioCityCodeRegionMap(List<String> iplCityCodes); static Map<Double, List<String>> buildRatioResidenceRegionMap(List<String> residenceCityNames);  }### Answer:
@Test public void getHourDayRatio() { List<Integer> list = new ArrayList(); list.add(0); list.add(14); list.add(23); double res = RequestDataConverter.getHourDayRatio(list); double exp = (2.905931696 + 4.219093269 + 2.900938686) / 100; assertEquals(exp, res, 0D); int[] A = new int[24]; list = new ArrayList(); for (int i : A) list.add(i); res = RequestDataConverter.getHourDayRatio(list); assertEquals(1D, res, 0D); }