title: Spring boot annotation @ConfigurationProperties doesn't work correctly classes with nested collection in Kotlin
body: <p>There is the data class with @ConfigurationProperties and @ConstructorBinding. This class contains the field which is collection.
  There are several property sources ( application.yml, application-dev1.yml) which initialize the first element of the collection.
  Binding for this element doesn't work correctly. Values for initialazation pulls only from one property source.
  Expected beahavior is the same as for field of type of some nested class:  merging values from all property sources.</p>
  <p><strong>Kotlin properties class</strong></p>
  <pre><code>@ConfigurationProperties(&quot;tpp.test.root&quot;)
  @ConstructorBinding
  data class RootPropperties(
     var rootField1: String = &quot;&quot;,
     var rootField2: String = &quot;&quot;,
     var nested: NestedProperties = NestedProperties(),
     var nestedList: List&lt;NestedListProperties&gt; = listOf()
  ) {
  
  data class NestedProperties(
      var nestedField1: String = &quot;&quot;,
      var nestedField2: String = &quot;&quot;
  )
  
  @ConstructorBinding
  data class NestedListProperties(
      var nestedListField1: String = &quot;&quot;,
      var nestedListField2: String = &quot;&quot;
  )
  }
  </code></pre>
  <p><strong>application.yml</strong></p>
  <pre><code>tpp:
    test:
      root:
        root-field1: default
        nested:
          nested-field1: default
        nested-list:
          - nested-list-field1: default
  </code></pre>
  <p><strong>application-dev1.yml</strong></p>
  <pre><code>tpp:
    test:
      root:
       root-field2: dev1
       nested:
         nested-field2: dev1
       nested-list:
         - nested-list-field2: dev1
  </code></pre>
  <p><strong>Test</strong></p>
  <pre><code>@ActiveProfiles(&quot;dev1&quot;)
  @SpringBootTest
  internal class ConfigurationPropertiesTest {
  
  @Autowired
  lateinit var environment: Environment
  
  @Autowired
  lateinit var rootPropperties: RootPropperties
  
      @Test
      fun `configuration properties binding`() {
           Assertions.assertEquals(&quot;default&quot;, rootPropperties.rootField1)
           Assertions.assertEquals(&quot;dev1&quot;, rootPropperties.rootField2)
  
           Assertions.assertEquals(&quot;default&quot;, rootPropperties.nested.nestedField1)
           Assertions.assertEquals(&quot;dev1&quot;, rootPropperties.nested.nestedField2)
  
           Assertions.assertTrue(rootPropperties.nestedList.isNotEmpty())
           //org.opentest4j.AssertionFailedError:
           //Expected :default
           //Actual   :
           Assertions.assertEquals(&quot;default&quot;, rootPropperties.nestedList[0].nestedListField1)
           Assertions.assertEquals(&quot;dev1&quot;, rootPropperties.nestedList[0].nestedListField2)
      }
  
       @Test
       fun `environment binding`() {
          Assertions.assertEquals(&quot;default&quot;, environment.getProperty(&quot;tpp.test.root.root-field1&quot;))
          Assertions.assertEquals(&quot;dev1&quot;, environment.getProperty(&quot;tpp.test.root.root-field2&quot;))
  
          Assertions.assertEquals(&quot;default&quot;, environment.getProperty(&quot;tpp.test.root.nested.nested-field1&quot;))
          Assertions.assertEquals(&quot;dev1&quot;, environment.getProperty(&quot;tpp.test.root.nested.nested-field2&quot;))
  
          Assertions.assertEquals(&quot;default&quot;, environment.getProperty(&quot;tpp.test.root.nested-list[0].nested-list-field1&quot;))
          Assertions.assertEquals(&quot;dev1&quot;, environment.getProperty(&quot;tpp.test.root.nested-list[0].nested-list-field2&quot;))
      }
  }
  </code></pre>
  <p>The test with RootProperties failed on <em>assertEquals(&quot;default&quot;, rootPropperties.nestedList[0].nestedListField1)</em> because <em>rootPropperties.nestedList[0].nestedListField1</em> has empty value. All other assertions tests pass sucessfully. The binding doesn't work correctly just for collection.</p>
  <p>At the same time the test with Environment passed successfully. And <em>Environment.getProperty(&quot;tpp.test.root.nested-list[0].nested-list-field1&quot;)</em> resolves corrected value: <em>&quot;default&quot;</em>.</p>
  <p>Spring boot version: 2.6.4</p>