title: Helper class as a singleton with Guice
body: <p>I'm learning Google Guice.
  I understood how to bind an interface to its implementation.</p>
  
  <p>Now, I have the following helper class :</p>
  
  <pre><code>class PersonHelper {
     public static FakeDatabaseConfiguration dbConfig;
     public PersonHelper(){
        if (dbConfig == null){
            dbConfig = new FakeDatabaseConfiguration();
            dbConfig.setHost('127.0.0.1');
            dbConfig.setPort('3306');
            dbConfig.setUsername('root');
            dbConfig.setPassword('root');
         }
     }
  
     public List&lt;Person&gt; getPersons(){
        FakeResult fakeResult = dbConfig.executeSQL("select * from Person");
        return fakeResult.asList();
     }
  }
  </code></pre>
  
  <p>Today, I'm using it like this:</p>
  
  <pre><code>PersonHelper personHelper = new PersonHelper();
  List&lt;Person&gt; personsList = personHelper. getPersons();
  </code></pre>
  
  <p>I'm pretty sure there is a way to make this class better.</p>
  
  <p>Question : How can I make this class as a singleton using Guice so that I don't lazy load the <code>dbConfig</code> variable at each instanciation ? 
  (I read that there is a <code>@Singleton</code> annotation but, it's considered in Guice just as a scope.)</p>
  
  <p>Regards</p>