title: Spring Boot loading a list from a config file returns empty list
body: <p>I just created a really basic spring boot application using spring initializer and am trying things out. I want to load a list from a yaml configuration file, but it always returns empty.</p>
  
  <p>I have a custom configuration class</p>
  
  <pre><code>@ConfigurationProperties("example-unit")
  @EnableConfigurationProperties
  public class ConfigurationUnit {
  
      public List&lt;String&gt; confiList = new ArrayList&lt;&gt;();
  
      public List&lt;String&gt; getConfiList() {
          return this.confiList;
      }
  
  }
  </code></pre>
  
  <p>And my main class looks like this</p>
  
  <pre><code>@SpringBootApplication
  public class DemoApplication {
  
      static ConfigurationUnit configurationUnit = new ConfigurationUnit();
  
  
      public static void main(String[] args) {
  
          SpringApplication.run(DemoApplication.class, args);
  
          List&lt;String&gt; hello = configurationUnit.getConfiList();
  
          System.out.print("");
      }
  
  }
  </code></pre>
  
  <p>I have put the application.yaml into resources folder.</p>
  
  <pre><code>example-unit:
    - string1
    - string2
    - hello22
  </code></pre>
  
  <p>I searched here and online, but can't figure out what's the issue and nothing I changed helped. I know I must be doing something wrong.</p>