    @Test
    public void createHotspotInfoTest() throws JSONException {

        String ssid = "DeviceSSID";
        int port = 3;
        String password = "password";
        String hotspotInfo = QRCodeUtils.createHotspotInfo(ssid, port, password);
        JSONObject hotspotInfoJson = new JSONObject(hotspotInfo);
        assertTrue(hotspotInfoJson.get(QRCodeUtils.SSID).equals(ssid));
        assertTrue(hotspotInfoJson.getInt(QRCodeUtils.PORT) == port);
        assertTrue(hotspotInfoJson.getBoolean(QRCodeUtils.PROTECTED));
        assertTrue(hotspotInfoJson.get(QRCodeUtils.PASSWORD).equals(password));

        password = null;
        hotspotInfo = QRCodeUtils.createHotspotInfo(ssid, port, password);
        hotspotInfoJson = new JSONObject(hotspotInfo);
        assertTrue(hotspotInfoJson.get(QRCodeUtils.SSID).equals(ssid));
        assertFalse(hotspotInfoJson.getBoolean(QRCodeUtils.PROTECTED));
        assertTrue(hotspotInfoJson.getInt(QRCodeUtils.PORT) == port);
    }