void () { final JpsModule module = myProject.addModule("m", JpsJavaModuleType.INSTANCE); final JpsLibrary library = myProject.addLibrary("l", JpsJavaLibraryType.INSTANCE); final JpsModule dep = myProject.addModule("dep", JpsJavaModuleType.INSTANCE); module.getDependenciesList().addLibraryDependency(library); module.getDependenciesList().addModuleDependency(dep); final List<? extends JpsDependencyElement> dependencies = module.getDependenciesList().getDependencies(); assertEquals(3, dependencies.size()); assertInstanceOf(dependencies.get(0), JpsModuleSourceDependency.class); assertSame(library, assertInstanceOf(dependencies.get(1), JpsLibraryDependency.class).getLibrary()); assertSame(dep, assertInstanceOf(dependencies.get(2), JpsModuleDependency.class).getModule()); }