@Test
public void testGetHttpAgent_badAgent() {

    when(mPropertySource.getHttpAgent()).thenReturn("Apache-HttpClient/UNAVAILABLE (java 1.4)");
    assertEquals("Dalvik/2.2.0 (Linux; U; Android 8.0.0; UnitTest Build/ABCDEF)", mDeviceHelper.getUserAgent());
    verify(mBuildInfo).getBuildId();
    verify(mBuildInfo).getModel();
    verify(mBuildInfo).getRelease();
    verify(mPropertySource).getJVMVersion();
    when(mPropertySource.getJVMVersion()).thenReturn(null);
    assertEquals("Dalvik/0.0.0 (Linux; U; Android 8.0.0; UnitTest Build/ABCDEF)", mDeviceHelper.getUserAgent());
}