### Question:
QRCodeUtils { public static Bitmap generateQRBitMap(String data, int sideLength) throws IOException, WriterException { Map<EncodeHintType, ErrorCorrectionLevel> hints = new HashMap<>(); hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L); QRCodeWriter qrCodeWriter = new QRCodeWriter(); BitMatrix bitMatrix = qrCodeWriter.encode(data, BarcodeFormat.QR_CODE, sideLength, sideLength, hints); Bitmap bmp = Bitmap.createBitmap(sideLength, sideLength, Bitmap.Config.RGB_565); for (int x = 0; x < sideLength; x++) { for (int y = 0; y < sideLength; y++) { bmp.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE); } } return bmp; } private  QRCodeUtils(); static Observable<Bitmap> generateQRCode(String ssid, int port, String password); static String createHotspotInfo(String ssid, int port, String password); static Bitmap generateQRBitMap(String data, int sideLength); static final String SSID; static final String PORT; static final String PROTECTED; static final String PASSWORD; static final int SIDE_LENGTH; }### Answer:
@Test public void generateQRBitMapTest() throws IOException, WriterException { String data = "Test Bitmap"; int sideLength = QRCodeUtils.SIDE_LENGTH; Bitmap bitmap = QRCodeUtils.generateQRBitMap(data, sideLength); assertTrue(bitmap.getHeight() == sideLength); assertTrue(bitmap.getWidth() == sideLength); }