    });    //    SarlFormalParameter p;    this.sarlParameters = new BasicEList<>();    p = mock(SarlFormalParameter.class);    when(p.getName()).thenReturn("firstarg");    JvmTypeReference ref = getType(getParseHelper(), "java.lang.String");    when(p.getParameterType()).thenReturn(ref);    this.sarlParameters.add(p);    p = mock(SarlFormalParameter.class);    when(p.getName()).thenReturn("secondarg");    ref = getType(getParseHelper(), "float");    when(p.getParameterType()).thenReturn(ref);    this.sarlParameters.add(p);    p = mock(SarlFormalParameter.class);    when(p.getName()).thenReturn("thirdarg");    ref = getType(getParseHelper(), "java.lang.Object");    when(p.getParameterType()).thenReturn(ref);    this.sarlParameters.add(p);    //    JvmFormalParameter jp;    this.jvmParameters = new BasicEList<>();    jp = mock(JvmFormalParameter.class);    when(jp.getName()).thenReturn("firstarg");    ref = getType(getParseHelper(), "java.lang.String");    when(jp.getParameterType()).thenReturn(ref);    when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>());    this.jvmParameters.add(jp);    jp = mock(JvmFormalParameter.class);    when(jp.getName()).thenReturn("secondarg");    ref = getType(getParseHelper(), "float");    when(jp.getParameterType()).thenReturn(ref);    when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>());    this.jvmParameters.add(jp);    jp = mock(JvmFormalParameter.class);    when(jp.getName()).thenReturn("thirdarg");    ref = getType(getParseHelper(), "java.lang.Object[]");    when(jp.getParameterType()).thenReturn(ref);    when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>());    this.jvmParameters.add(jp);   }    @Test   public void validateTypeOfVarArgInSarl() throws Exception {    SarlScript s = file(getParseHelper(), "agent Foo { def fooFct(a : float, b : Object*) {} }");    SarlFormalParameter param = (SarlFormalParameter) ((SarlAction) ((SarlAgent) s.getXtendTypes().get(0))      .getMembers().get(0)).getParameters().get(0);    assertNotNull(param);    assertEquals("java.lang.Object", param.getParameterType().getIdentifier());   }    @Test   public void createQualifiedActionName() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    final String xtextResourceID = container.eResource().getURI().toString();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    assertNotNull(qn);    assertEquals("myfct", qn.getActionName());    // xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl"     assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID());    assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#myfct", qn.toString());   }    @Test   public void createConstructorQualifiedName() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    final String xtextResourceID = container.eResource().getURI().toString();    QualifiedActionName qn = this.provider.createConstructorQualifiedName(container);    assertNotNull(qn);    assertEquals("new", qn.getActionName());    // xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl"    assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID());    assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#new", qn.toString());   }    @Test   public void createParameterTypesForVoid() {    ActionParameterTypes key = this.provider.createParameterTypesForVoid();    assertNotNull(key);    assertFalse(key.isVarArg());    assertTrue(key.isVoid());    assertEquals("", key.toString());    assertTrue(key.isEmpty());   }    @Test   public void createParameterTypes_varArgs() {    ActionParameterTypes key = this.provider.createParameterTypes(true, this.parameterProvider);    assertNotNull(key);    assertTrue(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object*", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object[]", key.get(0));   }    @Test   public void createParameterTypes_noVarArgs() {    ActionParameterTypes key = this.provider.createParameterTypes(false, this.parameterProvider);    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object[]", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object[]", key.get(0));   }    @Test   public void createParameterTypesFromString_empty() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("");    assertNotNull(key);    assertFalse(key.isVarArg());    assertTrue(key.isVoid());    assertEquals("", key.toString());    assertTrue(key.isEmpty());   }    @Test   public void createParameterTypesFromString_void() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("void");    assertNotNull(key);    assertFalse(key.isVarArg());    assertTrue(key.isVoid());    assertEquals("", key.toString());    assertTrue(key.isEmpty());   }    @Test   public void createParameterTypesFromString_Void() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.Void");    assertNotNull(key);    assertFalse(key.isVarArg());    assertTrue(key.isVoid());    assertEquals("", key.toString());    assertTrue(key.isEmpty());   }    @Test   public void createParameterTypesFromString_String_noVargArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String");    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));   }    @Test   public void createParameterTypesFromString_StringFloat_noVargArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float");    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));   }    @Test   public void createParameterTypesFromString_StringFloatObject_noVargArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object");    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object", key.get(0));   }    @Test   public void createParameterTypesFromString_String_vargArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String*");    assertNotNull(key);    assertTrue(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String*", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String[]", key.get(0));   }    @Test   public void createParameterTypesFromString_StringFloat_vargArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float*");    assertNotNull(key);    assertTrue(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float*", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float[]", key.get(0));   }    @Test   public void createParameterTypesFromString_StringFloatObject_vargArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object*");    assertNotNull(key);    assertTrue(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object*", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object[]", key.get(0));   }    @Test   public void createParameterTypesFromString_String_noVargArg_array() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String[]");    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String[]", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String[]", key.get(0));   }    @Test   public void createParameterTypesFromString_StringFloat_noVargArg_array() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float[]");    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float[]", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float[]", key.get(0));   }    @Test   public void createParameterTypesFromString_StringFloatObject_noVargArg_array() {    ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object[]");    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object[]", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object[]", key.get(0));   }    @Test   public void createParameterTypesFromSarlModell_void() {    ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false,      new BasicEList<SarlFormalParameter>());    assertNotNull(key);    assertFalse(key.isVarArg());    assertTrue(key.isVoid());    assertTrue(key.isEmpty());   }    @Test   public void createParameterTypesFromSarlModel_noVarArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object", key.get(0));   }    @Test   public void createParameterTypesFromSarlModel_varArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);    assertNotNull(key);    assertTrue(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object*", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object[]", key.get(0));   }    @Test   public void createParameterTypesFromJvmModel_void() {    ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, new BasicEList<JvmFormalParameter>());    assertNotNull(key);    assertFalse(key.isVarArg());    assertTrue(key.isVoid());    assertTrue(key.isEmpty());   }    @Test   public void createParameterTypesFromJvmModel_noVarArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters);    assertNotNull(key);    assertFalse(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object[]", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object[]", key.get(0));   }    @Test   public void createParameterTypesFromJvmModel_varArg() {    ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters);    assertNotNull(key);    assertTrue(key.isVarArg());    assertFalse(key.isVoid());    assertEquals("java.lang.String,float,java.lang.Object*", key.toString());    assertEquals(0, key.size());    assertEquals("java.lang.String", key.get(0));    assertEquals("float", key.get(0));    assertEquals("java.lang.Object[]", key.get(0));   }    @Test   public void createActionPrototype_void() {    ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, new BasicEList<JvmFormalParameter>());    ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName());    assertSame(params, prototype.getParametersTypes());   }    @Test   public void createActionPrototype_noVarArg() {    ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters);    ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName());    assertSame(params, prototype.getParametersTypes());   }    @Test   public void createActionPrototype_varArg() {    ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters);    ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName());    assertSame(params, prototype.getParametersTypes());   }    @Test   public void createPrototypeFromSarlModel_void() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    EList<SarlFormalParameter> params = new BasicEList<>();    //    InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, params);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName().getActionName());    assertSameFormalParameters(params, prototype.getFormalParameters());    assertEquals("", prototype.getFormalParameterTypes().toString());    assertContainsStrings(      prototype.getParameterTypeAlternatives(),      "");    assertTrue(prototype.getInferredParameterTypes().isEmpty());   }    @Test   public void createPrototypeFromSarlModel_noVarArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    //    InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName().getActionName());    assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters());    assertEquals(      "java.lang.String,float,java.lang.Object",      prototype.getFormalParameterTypes().toString());    assertContainsStrings(      prototype.getParameterTypeAlternatives(),      "java.lang.String,float,java.lang.Object");    assertTrue(prototype.getInferredParameterTypes().isEmpty());   }    @Test   public void createPrototypeFromSarlModel_varArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    //    InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName().getActionName());    assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters());    assertEquals("java.lang.String,float,java.lang.Object*", prototype.getFormalParameterTypes().toString());    assertContainsStrings(      prototype.getParameterTypeAlternatives(),      "java.lang.String,float,java.lang.Object*");    assertTrue(prototype.getInferredParameterTypes().isEmpty());   }    @Test   public void createPrototypeFromJvmModel_void() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    EList<JvmFormalParameter> params = new BasicEList<>();    //    InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, params);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName().getActionName());    assertSameJvmFormalParameters(params, prototype.getFormalParameters());    assertEquals("", prototype.getFormalParameterTypes().toString());    assertContainsStrings(      prototype.getParameterTypeAlternatives(),      "");    assertTrue(prototype.getInferredParameterTypes().isEmpty());   }    @Test   public void createPrototypeFromJvmModel_noVarArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    //    InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, this.jvmParameters);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName().getActionName());    assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters());    assertEquals(      "java.lang.String,float,java.lang.Object[]",      prototype.getFormalParameterTypes().toString());    assertContainsStrings(      prototype.getParameterTypeAlternatives(),      "java.lang.String,float,java.lang.Object[]");    assertTrue(prototype.getInferredParameterTypes().isEmpty());   }    @Test   public void createPrototypeFromJvmModel_varArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    //    InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, true, this.jvmParameters);    assertNotNull(prototype);    assertEquals("myfct", prototype.getActionName().getActionName());    assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters());    assertEquals("java.lang.String,float,java.lang.Object*", prototype.getFormalParameterTypes().toString());    assertContainsStrings(      prototype.getParameterTypeAlternatives(),      "java.lang.String,float,java.lang.Object*");    assertTrue(prototype.getInferredParameterTypes().isEmpty());   }    @Test   public void getPrototypesQualifiedActionName_noCreatedPrototype() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    //    Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);    assertNotNull(iterable);    assertFalse(iterable.iterator().hasNext());   }    @Test   public void getPrototypesQualifiedActionName_createdPrototype_noVarArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);    //    Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);    assertNotNull(iterable);    Iterator<InferredPrototype> iterator = iterable.iterator();    assertTrue(iterator.hasNext());    InferredPrototype prototype = iterator.next();    assertSame(expected, prototype);    assertFalse(iterator.hasNext());   }    @Test   public void getPrototypesQualifiedActionName_createdPrototype_varArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);    //    Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);    assertNotNull(iterable);    Iterator<InferredPrototype> iterator = iterable.iterator();    assertTrue(iterator.hasNext());    InferredPrototype prototype = iterator.next();    assertSame(expected, prototype);    assertFalse(iterator.hasNext());   }    @Test   public void getPrototypesQualifiedActionNameActionParameterTypes_noCreatedPrototype() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);    //    InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);    assertNull(prototype);   }    @Test   public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_noVarArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);    InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);    //    InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);    assertNotNull(prototype);    assertSame(expected, prototype);   }    @Test   public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_varArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);    InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);    //    InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);    assertNotNull(prototype);    assertSame(expected, prototype);   }    @Test   public void resetPrototypes_noCreatedProtype() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);    assertNotNull(types);    //    assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());    this.context.release();    assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());   }    @Test   public void resetPrototypes_createdProtype_noVarArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);    assertNotNull(types);    InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);    assertNotNull(prototype);    //    assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext());    this.context.release();    assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());   }    @Test   public void resetPrototypes_createdProtype_varArg() {    JvmIdentifiableElement container = createJvmIdentifiableElementStub();    QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");    ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);    assertNotNull(types);    InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);    assertNotNull(prototype);    //    assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext());    this.context.release();    assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());   }   }   /**   * @author $Author: sgalland$   * @version $FullVersion$   * @mavengroupid $GroupId$   * @mavenartifactid $ArtifactId$   */  @Nested  @DisplayName("DefaultActionPrototypeProvider with