code: public static boolean isPreviousEncoderSafeOrEqual(Encoder encoderToApply, Encoder previousEncoder) {
          return previousEncoder == encoderToApply || !encoderToApply.isApplyToSafelyEncoded() && previousEncoder.isSafe() && encoderToApply.isSafe()
                  || previousEncoder.getCodecIdentifier().isEquivalent(encoderToApply.getCodecIdentifier());
      }
docs: Checks if is previous encoder is already "safe", equal or equivalent
  
  @param encoderToApply
  the encoder to apply
  @param previousEncoder
  the previous encoder
  @return true, if previous encoder is already "safe", equal or equivalent