### Question:
Utils { public static Long parseFileSize(String v) { if (v == null) { return null; } v = deleteAllWhitespace(v); Matcher m = FILE_SIZE_PATTERN.matcher(v.toUpperCase()); if (!m.matches()) { throw new NumberFormatException("invalid file size format: '" + v + "'"); } long number = Long.parseLong(m.group(1)); String unit = m.group(2); String identifier = unit.substring(0, 1); int index = FILE_SIZE_UNITS.indexOf(identifier); if( index != -1) { for (int i = 0; i <= index; i++) { number = number * 1024; } } return number; } private  Utils(); static boolean matchAny(List<String> patterns, String value); static boolean matches(String pattern, String value); static boolean matches(Map<String, Object> conditions, Map<String, Object> data); static Long parseFileSize(String v);  }### Answer:
@Test public void testSimple() { String s = "100KB"; long result = Utils.parseFileSize(s); assertEquals(100 * 1024, result); }
@Test public void testTrim() { String s = " 100 kb "; long result = Utils.parseFileSize(s); assertEquals(100 * 1024, result); }