### Question:
WordUtils { public static String joinWords(String[] words, int len) { if (countWordsTotalLength(words) <= len) { return StringUtils.join(words).toLowerCase(); } int a = len / words.length; int b = len % words.length; StringBuilder buf = new StringBuilder(); int total = 0; int[] subLens = new int[words.length]; counting: for (int j = 0; j < len; j++) { for (int i = 0; i < words.length; i++) { int wordLen = words[i].length(); if (j < wordLen) { subLens[i] = j + 1; if (++total == len) { break counting; } } } } for (int i = 0; i < words.length; i++) { String word = words[i]; buf.append(StringUtils.substring(word, 0, subLens[i]).toLowerCase()); } return buf.toString(); }  static String joinWords(String[] words, int len); static String joinWordsWithPad(List<String> words, String separator, String pad); static String joinWordsWithPad(List<String> words, String separator, String leftPad, String rightPad); static int countWordsTotalLength(String[] words);  }### Answer:
@Test public void test() { String[] words = new String[]{"ABCDE", "12345"}; Assertions.assertEquals("abcd1234", WordUtils.joinWords(words, 8)); words = new String[]{"ABC", "123456"}; Assertions.assertEquals("abc12345", WordUtils.joinWords(words, 8)); words = new String[]{"ABC", "123"}; Assertions.assertEquals("abc123", WordUtils.joinWords(words, 8)); words = new String[]{"ABCDEF", "123"}; Assertions.assertEquals("abcde123", WordUtils.joinWords(words, 8)); }