Code example for HashMap

Methods: containsKey, get, size

0
        HashMap<String, ArrayList<IClassDescriptor>> found =
            mFrameworkClassLoader.findClassesDerivingFrom("jar.example.", new String[] {  //$NON-NLS-1$
                "jar.example.Class1",       //$NON-NLS-1$ 
                "jar.example.Class2" });    //$NON-NLS-1$ 
 
        assertTrue(found.containsKey("jar.example.Class1"));  //$NON-NLS-1$
        assertTrue(found.containsKey("jar.example.Class2"));  //$NON-NLS-1$
        assertEquals(2, found.size());  
        // Only Class2 derives from Class1.. 
        // Class1 and Class1$InnerStaticClass1 derive from Object and are thus ignored. 
        // Class1$InnerClass2 should never be seen either. 
        assertEquals("jar.example.Class2",  //$NON-NLS-1$
                found.get("jar.example.Class1").get(0).getFullClassName());  //$NON-NLS-1$
        assertEquals(1, found.get("jar.example.Class1").size());      //$NON-NLS-1$
        assertEquals(0, found.get("jar.example.Class2").size());      //$NON-NLS-1$
    } 
 
    // --- Utilities --- 
     
    /** 
     * Retrieves the private mFrameworkClassLoader.mClassCache field using reflection.