Code example for List

Methods: contains, size

0
        List<Weather> listWeatherResult = dataPersistenceManager 
            .loadAllDataFromCache(); 
 
        // THEN 
        assertNotNull(listWeatherResult); 
        assertEquals(2, listWeatherResult.size()); 
        assertTrue(listWeatherResult.contains(weatherRequestStatus)); 
        assertTrue(listWeatherResult.contains(weatherRequestStatus2)); 
    } 
 
    public void test_loadAllDataFromCache_with_no_requests_in_cache() 
        throws Exception { 
        // GIVEN 
 
        // WHEN 
        List<Weather> listWeather = dataPersistenceManager 
            .loadAllDataFromCache(); 
 
        // THEN 
        assertNotNull(listWeather); 
        assertTrue(listWeather.isEmpty());