static String joinAndEscapeStrings(final String[] strs,
      final char delimiterChar, final char escapeChar) {
    int len = strs.length;
    // Escape each string in string array.
    for (int index = 0; index < len; index++) {
      if (strs[index] == null) {
        return null;
      }
      strs[index] = escapeString(strs[index], delimiterChar, escapeChar);
    }
    // Join the strings after they have been escaped.
    return StringUtils.join(strs, delimiterChar);
  }
@Test
  void testJoinAndEscapeStrings() throws Exception {
    assertEquals("*!cluster!*!b**o***!xer!oozie**",
        TimelineReaderUtils.joinAndEscapeStrings(
            new String[]{"!cluster", "!b*o*!xer", "oozie*"}, '!', '*'));
    assertEquals("*!cluster!*!b**o***!xer!!",
        TimelineReaderUtils.joinAndEscapeStrings(
            new String[]{"!cluster", "!b*o*!xer", "", ""}, '!', '*'));
    assertNull(TimelineReaderUtils.joinAndEscapeStrings(
        new String[]{"!cluster", "!b*o*!xer", null, ""}, '!', '*'));
  }