Code example for Map

Methods: containsKey, size

0
    @Test     
    public void test() throws Exception { 
        Field field = ConstantImpl.class.getDeclaredField("STRINGS");
        field.setAccessible(true);
        Map<String, StringExpression> cache = (Map) field.get(null);
        System.out.println(cache.size() + " entries in ConstantImpl string cache");
 
        // numbers 
        assertTrue(cache.containsKey("0"));
        assertTrue(cache.containsKey("10"));
 
        // variables 
        assertTrue(cache.containsKey("animal"));
        assertTrue(cache.containsKey("cat"));
        assertTrue(cache.containsKey("category"));
        assertTrue(cache.containsKey("simpleTypes"));
 
        // properties 
        assertTrue(cache.containsKey("mate"));
 
    } 
 
}