@@ -0,0 +1,2050 @@
+package eme.model;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class IntermediateModelTest %7B%0A%0A    IntermediateModel model;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        model = new IntermediateModel(%22TestModel%22);%0A    %7D%0A%0A    @Test%0A    public void testAutoAdd() %7B%0A        addMVCPackages();%0A        model.add(new ExtractedClass(%22NormalClass%22, false));%0A        model.add(new ExtractedClass(%22main.AbstractClass%22, true));%0A        model.add(new ExtractedInterface(%22main.model.Interface%22));%0A        model.add(new ExtractedEnumeration(%22main.view.Enumeration%22));%0A        model.add(new ExtractedClass(%22main.controller.OuterClass$InnerClass%22, false));%0A        checkTypeAmount(model.getRoot(), 1);%0A    %7D%0A%0A    @Test%0A    public void testDuplicatePackage() %7B%0A        addMVCPackages();%0A        addMVCPackages();%0A        assertEquals(4, countPackages(model.getRoot()));%0A    %7D%0A%0A    @Test(expected = RuntimeException.class)%0A    public void testUnknownPackage() %7B%0A        addMVCPackages();%0A        model.add(new ExtractedPackage(%22illegal.subpackage%22));%0A        model.add(new ExtractedPackage(%22main.illegal.subpackage%22));%0A    %7D%0A%0A    private void addMVCPackages() %7B%0A        model.add(new ExtractedPackage(%22%22));%0A        model.add(new ExtractedPackage(%22main%22));%0A        model.add(new ExtractedPackage(%22main.model%22));%0A        model.add(new ExtractedPackage(%22main.view%22));%0A        model.add(new ExtractedPackage(%22main.controller%22));%0A    %7D%0A%0A    private void checkTypeAmount(ExtractedPackage fromPackage, int amountPerPackage) %7B%0A        assertEquals(amountPerPackage, fromPackage.getTypes().size());%0A        for (ExtractedPackage subpackage : fromPackage.getSubpackages()) %7B%0A            checkTypeAmount(subpackage, amountPerPackage);%0A        %7D%0A    %7D%0A%0A    private int countPackages(ExtractedPackage inPackage) %7B%0A        int amount = 0;%0A        for (ExtractedPackage subpackage : inPackage.getSubpackages()) %7B%0A            amount += 1 + countPackages(subpackage);%0A        %7D%0A        return amount;%0A    %7D%0A%7D%0A

Test case for the intermediate model.