private String[] combineArrays(String[] firstArray,String[] secondArray){
  Set<String> unionSet=new LinkedHashSet<>();
  unionSet.addAll(Arrays.asList(firstArray));
  unionSet.addAll(Arrays.asList(secondArray));
  return unionSet.toArray(new String[unionSet.size()]);
}

private String [ ] combineArrays ( String [ ] firstArray , String [ ] secondArray ) { Set < String > unionSet = new LinkedHashSet < > ( ) ; unionSet . addAll ( Arrays . asList ( firstArray ) ) ; unionSet . addAll ( Arrays . asList ( secondArray ) ) ; return unionSet . toArray ( new String [ unionSet . size ( ) ] ) ; }
builds the union of the arrays , taking first the elements of the firstarray and then the new elements of the secondarray .
