@Test
public void processNewTransmitterData_NormalBg_BatteryLifeTest() {

    // Setup
    Sensor mockSensor = createMockSensor();
    addMockBgReading(150, 15, mockSensor);
    addMockBgReading(150, 10, mockSensor);
    addMockBgReading(150, 5, mockSensor);
    Calibration.initialCalibration(150, 150, RuntimeEnvironment.application.getApplicationContext());
    int bgLevelBase = 150000;
    int minBatteryLevel = 3300;
    int maxBatteryLevel = 4500;
    int batteryRange = maxBatteryLevel - minBatteryLevel;
    for (int batteryLevel = maxBatteryLevel; batteryLevel >= minBatteryLevel; batteryLevel -= 50) {
        // Creating different bgLevels to avoid reading being rejected in TramsmitterData.
        String message = (bgLevelBase + batteryLevel) + " " + batteryLevel;
        // Act
        blueReader.decodeblueReaderPacket(message.getBytes(), message.length());
        // Verify
        assertWithMessage("batteryLevel: " + batteryLevel)
                .that(PersistentStore.getLong("blueReader_Full_Battery"))
                .isEqualTo(maxBatteryLevel);
        // Simplified calculation for days
        double days = 6.13d / (1d + Math.pow(batteryLevel / 3764d, -61d));
        if (batteryLevel < 3600) {
            days += 0.1;
        }
        String compare = BigDecimal.valueOf(days)
                .setScale(1, RoundingMode.HALF_UP)
                .toString();
        assertWithMessage("batteryLevel: " + batteryLevel)
                .that(PersistentStore.getString("bridge_battery_days"))
                .isEqualTo(compare);
        // Battery Percentage check
        int batteryPercentage = ((batteryLevel - minBatteryLevel) * 100 / batteryRange);
        assertWithMessage("batteryLevel: " + batteryLevel)
                .that(Sensor.currentSensor().latest_battery_level)
                .isEqualTo(batteryPercentage);
    }
}