code: public static String[] intersection(String[] arr1, String[] arr2) {
          if (arr1 == null || arr2 == null) {
              return null;
          }
          if (arr1.length == 0 || arr2.length == 0) {
              return new String[0];
          }
          List<String> list = new ArrayList<String>(Arrays.asList(arr1));
          list.retainAll(Arrays.asList(arr2));
          return list.toArray(new String[0]);
      }
docs: Returns intersection of given String arrays. If either array is {@code null}, then {@code null} is returned.
  
  @param arr1 first array
  @param arr2 second array
  @return arr1 without values which are not present in arr2