diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java
index 41baeb3..47e1364 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/Dependency.java
@@ -22,9 +22,11 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
+import java.util.Vector;
 
 import org.apache.felix.ipojo.FieldInterceptor;
 import org.apache.felix.ipojo.InstanceManager;
@@ -79,6 +81,12 @@
      * Thread Local.
      */
     private final ServiceUsage m_usage;
+    
+    /**
+     * Type of the object to inject.
+     * Cannot change once set.
+     */
+    private int m_type;
 
     /**
      * Nullable object.
@@ -416,42 +424,74 @@
      * @see org.apache.felix.ipojo.FieldInterceptor#onGet(java.lang.Object, java.lang.String, java.lang.Object)
      */
     public Object onGet(Object pojo, String fieldName, Object value) {        
-     //     Initialize the thread local object is not already touched.
+        // Initialize the thread local object is not already touched.
         Usage usage = (Usage) m_usage.get();
         if (usage.m_stack == 0) { // uninitialized usage.
-            ServiceReference[] refs = super.getServiceReferences();
-            if (isAggregate()) { // If we are aggregate we get the objects.
-                if (refs == null) {
-                    usage.m_objects = (Object[]) Array.newInstance(getSpecification(), 0); // Create an empty array.
-                } else {
-                   // Use a reflective construction to avoid class cast exception. This method allow to set the component type.
-                    usage.m_objects = (Object[]) Array.newInstance(getSpecification(), refs.length); 
-                    for (int i = 0; refs != null && i < refs.length; i++) {
-                        ServiceReference ref = refs[i];
-                        usage.m_objects[i] = getService(ref);
-                    }
-                }
-            } else { // We are not aggregate.
-                // Use a reflective construction to avoid class cast exception. This method allow to set the component type.
-                usage.m_objects = (Object[]) Array.newInstance(getSpecification(), 1);
-                if (refs == null) {
-                    if (m_nullable == null && m_supportNullable) {
-                        m_handler.warn("[" + m_handler.getInstanceManager().getInstanceName() + "] The dependency is not optional, however no service object can be injected in " + m_field + " -> " + getSpecification().getName());
-                    }
-                    usage.m_objects[0] = m_nullable; // Add null if the Nullable pattern is disable.
-                } else {
-                    ServiceReference ref = getServiceReference();
-                    usage.m_objects[0] = getService(ref);
-                }
-            }
-            usage.inc(); // Start the tracking, so fix the stack level to 1
+            createServiceObject(usage);
+            usage.inc(); // Start the caching, so set the stack level to 1
             m_usage.set(usage);
         }
 
-        if (isAggregate()) { // Multiple dependency
-            return usage.m_objects;
+        return usage.m_object;
+
+    }
+
+    
+    /**
+     * Creates the object to store in the given Thread Local.
+     * This object will be injected inside the POJO field.
+     * @param usage : Thread Local to populate.
+     */
+    private void createServiceObject(Usage usage) {
+        ServiceReference[] refs = getServiceReferences();
+        if (! isAggregate()) {
+            if (refs == null) {
+                if (m_nullable == null && m_supportNullable) {
+                    m_handler.warn("[" + m_handler.getInstanceManager().getInstanceName() + "] The dependency is not optional, however no service object can be injected in " + m_field + " -> " + getSpecification().getName());
+                }
+                usage.m_object = m_nullable; // Add null if the Nullable pattern is disable.
+            } else {
+                ServiceReference ref = getServiceReference();
+                usage.m_object = getService(ref);
+            }
         } else {
-            return usage.m_objects[0];
+            if (m_type == 0) { // Array
+                if (refs == null) {
+                    usage.m_object = (Object[]) Array.newInstance(getSpecification(), 0); // Create an empty array.
+                } else {
+                   // Use a reflective construction to avoid class cast exception. This method allows setting the component type.
+                    Object[] objs = (Object[]) Array.newInstance(getSpecification(), refs.length); 
+                    for (int i = 0; refs != null && i < refs.length; i++) {
+                        ServiceReference ref = refs[i];
+                        objs[i] = getService(ref);
+                    }
+                    usage.m_object = objs;
+                }
+            } else if (m_type == 1) {
+                if (refs == null) {
+                    usage.m_object = new ArrayList(0); // Create an empty list.
+                } else {
+                   // Use a list to store service objects
+                    List objs = new ArrayList(refs.length); 
+                    for (int i = 0; refs != null && i < refs.length; i++) {
+                        ServiceReference ref = refs[i];
+                        objs.add(getService(ref));
+                    }
+                    usage.m_object = objs;
+                }
+            } else if (m_type == 2) {
+                if (refs == null) {
+                    usage.m_object = new Vector(0); // Create an empty vector.
+                } else {
+                   // Use a vector to store service objects
+                    Vector objs = new Vector(refs.length); 
+                    for (int i = 0; refs != null && i < refs.length; i++) {
+                        ServiceReference ref = refs[i];
+                        objs.add(getService(ref));
+                    }
+                    usage.m_object = objs;
+                }
+            }
         }
     }
 
@@ -538,4 +578,14 @@
         return m_di;
     }
 
+    /**
+     * Set the type to inject.
+     * This method set the dependency as aggregate.
+     * @param type either list of vector
+     */
+    protected void setType(int type) {
+        setAggregate(true);
+        m_type = type;
+    }
+
 }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
index 27c0371..dcc9fb9 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
@@ -20,6 +20,8 @@
 
 import java.util.Comparator;
 import java.util.Dictionary;
+import java.util.List;
+import java.util.Vector;
 
 import org.apache.felix.ipojo.ConfigurationException;
 import org.apache.felix.ipojo.IPojoContext;
@@ -44,6 +46,18 @@
 public class DependencyHandler extends PrimitiveHandler implements DependencyStateListener {
 
     /**
+     * Dependency field type : Vector
+     * The dependency will be injected as a vector.
+     */
+    protected static final int VECTOR = 2;
+
+    /**
+     * Dependency Field Type : List.
+     * The dependency will be injected as a list.
+     */
+    protected static final int LIST = 1;
+
+    /**
      * List of dependencies of the component.
      */
     private Dependency[] m_dependencies = new Dependency[0];
@@ -198,6 +212,12 @@
                 // Set the dependency to multiple
                 dep.setAggregate(true);
                 type = type.substring(0, type.length() - 2);
+            } else if (type.equals(List.class.getName())) {
+                dep.setType(LIST);
+                type = null;
+            } else if (type.equals(Vector.class.getName())) {
+                dep.setType(VECTOR);
+                type = null;
             } else {
                 if (dep.isAggregate()) {
                     throw new ConfigurationException("A required service is not correct : the field "
@@ -205,7 +225,7 @@
                             + " must be an array to support aggregate injections");
                 }
             }
-            setSpecification(dep, type, true); // Throw an exception if the filed type mismatch.
+            setSpecification(dep, type, true); // Throws an exception if the field type mismatch.
         }
 
         // Check that all required info are set
@@ -220,31 +240,42 @@
      * @throws ConfigurationException : the specification class cannot be loaded correctly
      */
     private void setSpecification(Dependency dep, String className, boolean error) throws ConfigurationException {
-        // We have to set the dependency in two cases : either the dependency as no specification, or the specification is different from the given
-        // one
-        if (dep.getSpecification() == null || !dep.getSpecification().getName().equals(className)) {
-            if (dep.getSpecification() != null) {
+        if (className == null) {
+            // No found type (list and vector)
+            if (dep.getSpecification() == null) {
                 if (error) {
-                    throw new ConfigurationException("A required service is not correct : the discoevered type ["
+                    throw new ConfigurationException("Cannot discover the required specification for " + dep.getField());
+                } else {
+                    // If the specification is different, warn that we will override it.
+                    warn("Cannot discover the required specification for " + dep.getField());
+                }
+            }
+        } else { // In all other case, className is not null.
+            if (dep.getSpecification() == null || !dep.getSpecification().getName().equals(className)) {
+                if (dep.getSpecification() != null) {
+                    if (error) {
+                        throw new ConfigurationException("A required service is not correct : the discovered type ["
                             + className
                             + "] and the specified (or already discovered)  service interface ["
                             + dep.getSpecification().getName()
                             + "] are not the same");
-                } else {
-                    // If the specification is different, warn that we will overide it.
-                    warn("[DependencyHandler on "
+                    } else {
+                        // If the specification is different, warn that we will override it.
+                        warn("[DependencyHandler on "
                             + getInstanceManager().getInstanceName()
                             + "] The field type ["
                             + className
                             + "] and the needed service interface ["
                             + dep.getSpecification()
                             + "] are not the same");
+                    }
                 }
-            }
-            try {
-                dep.setSpecification(getInstanceManager().getContext().getBundle().loadClass(className));
-            } catch (ClassNotFoundException e) {
-                throw new ConfigurationException("The required service interface cannot be loaded : " + e.getMessage());
+            
+                try {
+                    dep.setSpecification(getInstanceManager().getContext().getBundle().loadClass(className));
+                } catch (ClassNotFoundException e) {
+                    throw new ConfigurationException("The required service interface cannot be loaded : " + e.getMessage());
+                }
             }
         }
     }
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/ServiceUsage.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/ServiceUsage.java
index 7d289f1..5a8d5c5 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/ServiceUsage.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/ServiceUsage.java
@@ -36,12 +36,12 @@
          */
         int m_stack = 0;
         /**
-         * List of used objects.
+         * Object to inject.
          */
-        Object[] m_objects;
+        Object m_object;
         
         /**
-         * Increment the statck level.
+         * Increment the stack level.
          */
         public void inc() {
             m_stack++;
@@ -60,7 +60,7 @@
          * Clear the service object array.
          */
         public void clear() {
-            m_objects = null;
+            m_object = null;
         }
         
     }
diff --git a/ipojo/pom.xml b/ipojo/pom.xml
index 962a68a..474adc1 100644
--- a/ipojo/pom.xml
+++ b/ipojo/pom.xml
@@ -80,4 +80,17 @@
 		</modules>
 	</profile>
   </profiles>
+  
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <aggregate>true</aggregate>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+
 </project>
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java
new file mode 100644
index 0000000..52d9f5f
--- /dev/null
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java
@@ -0,0 +1,159 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+import org.osgi.framework.ServiceReference;
+
+public class ListCheckService implements CheckService {
+
+    List fs;
+
+    int simpleB = 0;
+
+    int objectB = 0;
+
+    int refB = 0;
+
+    int bothB = 0;
+
+    int simpleU = 0;
+
+    int objectU = 0;
+
+    int refU = 0;
+
+    int bothU = 0;
+
+    public boolean check() {
+        boolean r = fs.size() != 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r & ((FooService) fs.get(i)).foo();
+        }
+        return r;
+    }
+
+    private boolean getBoolean() {
+        return check();
+    }
+
+    private int getInt() {
+        int r = 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getInt();
+        }
+        return r;
+    }
+
+    private long getLong() {
+        long r = 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getLong();
+        }
+        return r;
+    }
+
+    private double getDouble() {
+        double r = 0.0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getDouble();
+        }
+        return r;
+    }
+
+    protected Object doNothing(Object o, String s) {
+        return null;
+    }
+
+    // private Object getObject() {
+    // boolean r = true;
+    // for(int i = 0; i < fs.length; i++) {
+    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
+    // }
+    // return new Boolean(r);
+    // }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("result", new Boolean(check()));
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+        props.put("boolean", new Boolean(getBoolean()));
+        props.put("int", new Integer(getInt()));
+        props.put("long", new Long(getLong()));
+        props.put("double", new Double(getDouble()));
+
+        return props;
+    }
+
+    public void voidBind() {
+        simpleB++;
+    }
+
+    public void voidUnbind() {
+        simpleU++;
+    }
+
+    public void objectBind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectB++;
+        }
+    }
+
+    public void objectUnbind(FooService o) {
+        if (o != null && o instanceof FooService) {
+            objectU++;
+        }
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+    }
+
+    public void refUnbind(ServiceReference sr) {
+        if (sr != null) {
+            refU++;
+        }
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothB++;
+        }
+    }
+
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothU++;
+        }
+    }
+
+}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/VectorCheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/VectorCheckService.java
new file mode 100644
index 0000000..6c7011f
--- /dev/null
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/VectorCheckService.java
@@ -0,0 +1,159 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+import java.util.Vector;
+
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+import org.osgi.framework.ServiceReference;
+
+public class VectorCheckService implements CheckService {
+
+    Vector fs;
+
+    int simpleB = 0;
+
+    int objectB = 0;
+
+    int refB = 0;
+
+    int bothB = 0;
+
+    int simpleU = 0;
+
+    int objectU = 0;
+
+    int refU = 0;
+
+    int bothU = 0;
+
+    public boolean check() {
+        boolean r = fs.size() != 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r & ((FooService) fs.get(i)).foo();
+        }
+        return r;
+    }
+
+    private boolean getBoolean() {
+        return check();
+    }
+
+    private int getInt() {
+        int r = 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getInt();
+        }
+        return r;
+    }
+
+    private long getLong() {
+        long r = 0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getLong();
+        }
+        return r;
+    }
+
+    private double getDouble() {
+        double r = 0.0;
+        for (int i = 0; i < fs.size(); i++) {
+            r = r + ((FooService) fs.get(i)).getDouble();
+        }
+        return r;
+    }
+
+    protected Object doNothing(Object o, String s) {
+        return null;
+    }
+
+    // private Object getObject() {
+    // boolean r = true;
+    // for(int i = 0; i < fs.length; i++) {
+    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
+    // }
+    // return new Boolean(r);
+    // }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("result", new Boolean(check()));
+        props.put("voidB", new Integer(simpleB));
+        props.put("objectB", new Integer(objectB));
+        props.put("refB", new Integer(refB));
+        props.put("bothB", new Integer(bothB));
+        props.put("voidU", new Integer(simpleU));
+        props.put("objectU", new Integer(objectU));
+        props.put("refU", new Integer(refU));
+        props.put("bothU", new Integer(bothU));
+        props.put("boolean", new Boolean(getBoolean()));
+        props.put("int", new Integer(getInt()));
+        props.put("long", new Long(getLong()));
+        props.put("double", new Double(getDouble()));
+
+        return props;
+    }
+
+    public void voidBind() {
+       // simpleB++;
+    }
+
+    public void voidUnbind() {
+       // simpleU++;
+    }
+
+    public void objectBind(FooService o) {
+        if (o != null && o instanceof FooService) {
+     //       objectB++;
+        }
+    }
+
+    public void objectUnbind(FooService o) {
+        if (o != null && o instanceof FooService) {
+    //        objectU++;
+        }
+    }
+
+    public void refBind(ServiceReference sr) {
+        if (sr != null) {
+            refB++;
+        }
+    }
+
+    public void refUnbind(ServiceReference sr) {
+        if (sr != null) {
+            refU++;
+        }
+    }
+
+    public void bothBind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothB++;
+        }
+    }
+
+    public void bothUnbind(FooService o, ServiceReference sr) {
+        if (o != null && o instanceof FooService && sr != null) {
+            bothU++;
+        }
+    }
+
+}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
index d19c752..ae38291 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
@@ -47,6 +47,8 @@
         ots.addTestSuite(MethodDelayedOptionalMultipleDependencies.class);
         ots.addTest(DefaultImplementationTestSuite.suite(bc));
         ots.addTestSuite(DependencyArchitectureTest.class);
+        ots.addTestSuite(ListMultipleDependencies.class);
+        ots.addTestSuite(VectorMultipleDependencies.class);
 		return ots;
 	}
 
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java
new file mode 100644
index 0000000..47b11ff
--- /dev/null
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java
@@ -0,0 +1,248 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.architecture.InstanceDescription;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class ListMultipleDependencies extends OSGiTestCase {
+
+	ComponentInstance instance1, instance2;
+	ComponentInstance fooProvider1, fooProvider2;
+	
+	public void setUp() {
+		try {
+			Properties prov = new Properties();
+			prov.put("name", "FooProvider1");
+			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1.stop();
+		
+			Properties prov2 = new Properties();
+			prov2.put("name", "FooProvider2");
+			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2.stop();
+		
+			Properties i1 = new Properties();
+			i1.put("name", "Simple");
+			instance1 = Utils.getFactoryByName(context, "SimpleListCheckServiceProvider").createComponentInstance(i1);
+			
+			Properties i2 = new Properties();
+            i2.put("name", "Optional");
+            instance2 = Utils.getFactoryByName(context, "OptionalListCheckServiceProvider").createComponentInstance(i2);
+		} catch(Exception e) { fail(e.getMessage()); }
+		
+	}
+	
+	public void tearDown() {
+		instance1.dispose();
+		instance2.dispose();
+		fooProvider1.dispose();
+		fooProvider2.dispose();
+		instance1 = null;
+		instance2 = null;
+		fooProvider1 = null;
+		fooProvider2 = null;
+	}
+	
+	public void testSimple() {
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		assertNotNull("Check architecture availability", arch_ref);
+		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+		
+		fooProvider1.start();
+		
+		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
+		
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		assertNotNull("Check CheckService availability", cs_ref);
+		CheckService cs = (CheckService) context.getService(cs_ref);
+		Properties props = cs.getProps();
+		//Check properties
+		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
+		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
+		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
+		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
+		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
+		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
+		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
+		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
+		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
+		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
+		
+		fooProvider2.start();
+		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+		
+		cs = (CheckService) context.getService(cs_ref);
+		props = cs.getProps();
+		//Check properties
+		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
+		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
+		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
+		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
+		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
+		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
+		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
+		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
+		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
+		
+		fooProvider1.stop();
+		
+		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
+		
+		cs = (CheckService) context.getService(cs_ref);
+		props = cs.getProps();
+		//Check properties
+		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
+		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
+		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
+		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
+		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
+		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
+		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
+		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
+		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
+		
+		fooProvider2.stop();
+		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
+		
+		id = null;
+		cs = null;
+		context.ungetService(arch_ref);
+		context.ungetService(cs_ref);
+	}
+	
+	public void testOptional() {
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
+        
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) context.getService(cs_ref);
+        Properties props = cs.getProps();
+        //Check properties
+        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
+        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
+        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
+        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
+        
+        fooProvider1.start();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
+        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
+        
+        fooProvider2.start();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
+        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
+        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
+        
+        fooProvider1.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
+        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
+        
+        fooProvider2.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
+        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
+        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
+        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
+        
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        context.ungetService(cs_ref);       
+    }
+	
+}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java
new file mode 100644
index 0000000..e83c480
--- /dev/null
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java
@@ -0,0 +1,248 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.test.scenarios.service.dependency;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.architecture.InstanceDescription;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class VectorMultipleDependencies extends OSGiTestCase {
+
+	ComponentInstance instance1, instance2;
+	ComponentInstance fooProvider1, fooProvider2;
+	
+	public void setUp() {
+		try {
+			Properties prov = new Properties();
+			prov.put("name", "FooProvider1");
+			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1.stop();
+		
+			Properties prov2 = new Properties();
+			prov2.put("name", "FooProvider2");
+			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2.stop();
+		
+			Properties i1 = new Properties();
+			i1.put("name", "Simple");
+			instance1 = Utils.getFactoryByName(context, "SimpleVectorCheckServiceProvider").createComponentInstance(i1);
+			
+			Properties i2 = new Properties();
+            i2.put("name", "Optional");
+            instance2 = Utils.getFactoryByName(context, "OptionalVectorCheckServiceProvider").createComponentInstance(i2);
+		} catch(Exception e) { fail(e.getMessage()); }
+		
+	}
+	
+	public void tearDown() {
+		instance1.dispose();
+		instance2.dispose();
+		fooProvider1.dispose();
+		fooProvider2.dispose();
+		instance1 = null;
+		instance2 = null;
+		fooProvider1 = null;
+		fooProvider2 = null;
+	}
+	
+	public void testSimple() {
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		assertNotNull("Check architecture availability", arch_ref);
+		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+		
+		fooProvider1.start();
+		
+		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
+		
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		assertNotNull("Check CheckService availability", cs_ref);
+		CheckService cs = (CheckService) context.getService(cs_ref);
+		Properties props = cs.getProps();
+		//Check properties
+		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
+		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
+		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
+		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
+		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
+		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
+		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
+		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
+		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
+		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
+		
+		fooProvider2.start();
+		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+		
+		cs = (CheckService) context.getService(cs_ref);
+		props = cs.getProps();
+		//Check properties
+		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
+		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
+		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
+		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
+		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
+		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
+		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
+		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
+		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
+		
+		fooProvider1.stop();
+		
+		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
+		
+		cs = (CheckService) context.getService(cs_ref);
+		props = cs.getProps();
+		//Check properties
+		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
+		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
+		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
+		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
+		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
+		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
+		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
+		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
+		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
+		
+		fooProvider2.stop();
+		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
+		
+		id = null;
+		cs = null;
+		context.ungetService(arch_ref);
+		context.ungetService(cs_ref);
+	}
+	
+	public void testOptional() {
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
+        
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) context.getService(cs_ref);
+        Properties props = cs.getProps();
+        //Check properties
+        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
+        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
+        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
+        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
+        
+        fooProvider1.start();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
+        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
+        
+        fooProvider2.start();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
+        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
+        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
+        
+        fooProvider1.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
+        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
+        
+        fooProvider2.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
+        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
+        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
+        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
+        
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        context.ungetService(cs_ref);       
+    }
+	
+}
diff --git a/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml b/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml
index 994afeb..b08fd6e 100644
--- a/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml
+++ b/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml
@@ -424,4 +424,37 @@
 		<provides />
 	</component>
 	
+	<!-- Aggregate dependency as List -->
+	<component
+		className="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
+		name="SimpleListCheckServiceProvider" architecture="true">
+		<requires field="fs" interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
+		<provides />
+	</component>
+	<component
+		className="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
+		name="OptionalListCheckServiceProvider"
+		architecture="true">
+		<requires interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
+		<provides />
+	</component>
+	
+		<!-- Aggregate dependency as Vector -->
+	<component
+		className="org.apache.felix.ipojo.test.scenarios.component.VectorCheckService"
+		name="SimpleVectorCheckServiceProvider" architecture="true">
+		<requires field="fs">
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides />
+	</component>
+	<component
+		className="org.apache.felix.ipojo.test.scenarios.component.VectorCheckService"
+		name="OptionalVectorCheckServiceProvider"
+		architecture="true">
+		<requires interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
+		<provides />
+	</component>
+	
 </ipojo>
