code: public void registerScanModifier(ScanModifier scanModifier) {
      int currentIndex = scanModifiers.indexOf(scanModifier);
      if(currentIndex == -1) {
        scanModifiers.add(scanModifier);
      } else {
        scanModifiers.set(currentIndex, scanModifier);
      }
    }
docs: Register a ScanModifier to be called before every Scan is executed on
  HBase. This ScanModifier will be replaced if already registered and added
  if not. Equality is checked by calling the equals() on the scanModifier passed.
  ScanModifiers will be called in the order they are added,
  so if any modifier is destructive, it must be added in the
  right order.
  
  Not Thread Safe
  @param scanModifier The ScanModifier to register.