code: @Override
    public Filter adapt(FilterAdapterContext context, FamilyFilter filter)
        throws IOException {
      CompareOp compareOp = filter.getOperator();
      if (compareOp != CompareFilter.CompareOp.EQUAL) {
        throw new IllegalStateException(String.format("Cannot adapt operator %s",
          compareOp == null ? null : compareOp.getClass().getCanonicalName()));
      }
  
      ByteArrayComparable comparator = filter.getComparator();
      String family = null;
      if (comparator == null) {
        throw new IllegalStateException("Comparator cannot be null"); 
      } else if (comparator instanceof RegexStringComparator) {
        family = Bytes.toString(comparator.getValue());
      } else if (comparator instanceof BinaryComparator) {
        ByteString quotedRegularExpression =
            ReaderExpressionHelper.quoteRegularExpression(comparator.getValue());
        family = quotedRegularExpression.toStringUtf8();
      } else {
        throw new IllegalStateException(
            "Cannot adapt comparator " + comparator.getClass().getCanonicalName());
      }
      return FILTERS.family().regex(family);
    }
docs: {@inheritDoc}