protected final void optimizeHints() {
        // clear hints for re-optimization
        this.writerHintMap.clear();
        this.readerHintMap.clear();

        // writer hints
        String format = this.params.getFormat().toString();

        // only for QR code. AZTEC uses zxing's default error correction 33%.
        if (format.equals(BarcodeFormat.QR_CODE.toString())) {
            this.writerHintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
        }

        if (format.equals(BarcodeFormat.DATA_MATRIX.toString())) {
            this.writerHintMap.put(EncodeHintType.DATA_MATRIX_SHAPE, SymbolShapeHint.FORCE_SQUARE);
        }

        // reader hints
        this.readerHintMap.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
    }
@Test
    final void testOptimizeHints() throws IOException {
        try (BarcodeDataFormat instance = new BarcodeDataFormat()) {
            assertTrue(instance.getWriterHintMap().containsKey(EncodeHintType.ERROR_CORRECTION));
            assertTrue(instance.getReaderHintMap().containsKey(DecodeHintType.TRY_HARDER));
        }
    }