code: static int binarySearch(final boolean[] a, final boolean key) {
          if (N.isNullOrEmpty(a)) {
              return N.INDEX_NOT_FOUND;
          }
  
          if (a[0] == key) {
              return 0;
          } else if (a[a.length - 1] != key) {
              return N.INDEX_NOT_FOUND;
          }
  
          int left = 0, right = a.length - 1;
          while (left < right) {
              int mid = left + (right - left) / 2;
  
              if (a[mid] == key) {
                  right = mid;
              } else {
                  left = mid + 1;
              }
          }
          return left;
      }
docs: {@link Arrays#binarySearch(boolean[], boolean)}
  
  @param a
  @param key
  @return