### Question:
Utils { public static Pair<Integer, String> processFileWithDelimiter(String filePath, String charset, Consumer<String> func, String delimiter) { BufferedReader bufferedReader = null; try { int count = 0; bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), charset)); String line; StringBuilder str = new StringBuilder(); while ((line = bufferedReader.readLine()) != null) { if (line.startsWith("#")) { continue; } if (line.contains(delimiter)) { int index = line.indexOf(delimiter); str.append(line.substring(0, index + 1)); String content = str.toString(); func.accept(content); str.delete(0, str.length()); str.append(line.substring(index + 1)); count++; } else { str.append(line); } } return Pair.of(count, str.toString()); } catch (IOException e) { throw new RuntimeException(e); } finally { try { if (bufferedReader != null) { bufferedReader.close(); } } catch (IOException e) { throw new RuntimeException(e); } } }  static O cast(Object object); static String sanitize(String input); static String humanReadableBytes(long bytes); static String humanReadableBytes(long bytes, boolean si); static Long maybeUndefined(long val); static int[] getBitArray(SliceInput input, int numOfBits); static List<String> getFromBitArray(List<T> list, int[] bitArray, Function<T, String> func); static List<T> makeNotNull(List<T> list); static boolean allEmpty(Collection<?>... collections); static boolean noneEmpty(Collection<?>... collections); static boolean anyElementEmpty(Collection<?> collection); @VisibleForTesting static int castCompare(List<Object> recordKey, List<Object> targetKey); static int castCompare(List<Object> recordKey, List<Object> targetKey,
                                List<Column> keyColumnList); static int castCompare(Object recordKey, Object targetKey, Column column); static void close(Closeable closeable); static List<Object> constructMaxRecord(int keyLen); static List<Object> constructMinRecord(int keyLen); static List<Object> expandRecord(List<Object> key, ComparisonOperator operator, int keyLen); static Pair<Integer, String> processFileWithDelimiter(String filePath, String charset,
                                                               Consumer<String> func, String delimiter); static boolean isOptionalPresent(Optional<T> optional); static String tailTrim(String value); static String formatDate(int year, int month, int day); static String formatIntLessThan10000(int val); static String formatIntLessThan100(int val); static Timestamp convertDateTime(String s, int precision); static LocalDateTime parseDateTimeText(String s); static LocalDateTime parseDateTimeText(String s, int precision); static Time convertTime(String s, int precision); static LocalTime parseTimeText(String s); static LocalTime parseTimeText(String s, int precision); static TimeZone getTimeZone(); static final DateTimeFormatter[] TIME_FORMAT_TIMESTAMP; static final DateTimeFormatter[] TIME_FORMAT_TIME; }### Answer:
@Test public void testProcessFileWithDelimiter() { String filePath = "src/test/resources/test.sql"; String delimiter = ";"; List<String> list = new ArrayList<>(); Utils.processFileWithDelimiter(filePath, "UTF-8", s -> { if (s.startsWith("CREATE TABLE")) { list.add(s.trim()); } }, delimiter); assertThat(list.isEmpty(), is(false)); for (String s : list) { System.out.println(s); assertThat(s.startsWith("CREATE TABLE"), is(true)); assertThat(s.endsWith(";"), is(true)); } }