question: public static String [ ] mergeStringArrays ( String [ ] array1 , String [ ] array2 ) { if ( ObjectUtils . isEmpty ( array1 ) ) { return array2 ; } if ( ObjectUtils . isEmpty ( array2 ) ) { return array1 ; } List < String > result = new ArrayList < String > ( ) ; result . addAll ( Arrays . asList ( array1 ) ) ; for ( String str : array2 ) { if ( ! result . contains ( str ) ) { result . add ( str ) ; } } return toStringArray ( result ) ; }
target:  Merge the given String arrays into one, with overlapping array elements only included once. <p>The order of elements in the original arrays is preserved (with the exception of overlapping elements, which are only included on their first occurrence).