TagsUtil { public static String[] add(String[] base, String... extraTags) { if (null == base || base.length == 0) { return extraTags; } if (extraTags.length == 0) { return base; } List<String> tags = new ArrayList<>(Arrays.asList(base)); tags.addAll(Arrays.asList(extraTags)); return tags.toArray(new String[tags.size()]); } private  TagsUtil(); static String[] add(String[] base, String... extraTags);  }
@Test public void add() { assertThat(TagsUtil.add(null)).isEqualTo(new String[0]); assertThat(TagsUtil.add(null, "alb")).isEqualTo(TEST_TAGS_ALB); assertThat(TagsUtil.add(TEST_TAGS_BLA)).isEqualTo(TEST_TAGS_BLA); assertThat(TagsUtil.add(TEST_TAGS_BLA, "alb")).isEqualTo(TEST_TAGS_BLA_ALB); }