code: public static int countCommonElements(int[] arra, int[] arrb) {
  
          int k = 0;
  
          for (int i = 0; i < arra.length; i++) {
              for (int j = 0; j < arrb.length; j++) {
                  if (arra[i] == arrb[j]) {
                      k++;
                  }
              }
          }
  
          return k;
      }
docs: Returns the number of elements shared between the two arrays containing
  sets.<p>
  
  Return the number of elements shared by two column index arrays.
  This method assumes that each of these arrays contains a set (each
  element index is listed only once in each index array). Otherwise the
  returned number will NOT represent the number of unique column indexes
  shared by both index array.
  
  @param arra int[]; first array of column indexes.
  
  @param arrb int[]; second array of column indexes
  
  @return int; number of elements shared by <code>a</code> and <code>b</code>