title: Is it OK to use Gson instance as a static field in a model bean (reuse)?
body: <p>Here's the model I implemented:</p>
  
  <pre><code>public class LoginSession {
      private static final Gson gson = new Gson();
  
      private String id;
      private String name;
      private long timestamp;
  
      public LoginSession(String id, String name) {
          this.id = id;
          this.name = name;
          this.timestamp = System.currentTimeMillis();
      }
  
      public String toJson() {
          return gson.toJson(this);
      }
  
      public static LoginSession fromJson(String json) {
          checkArgument(!isNullOrEmpty(json));
          return gson.fromJson(json, LoginSession.class);
      }
  }
  </code></pre>
  
  <p>I thought it's useless to create new Gson instance for every LoginSession instance.</p>
  
  <p>But what I'm worried about is thread-safety issues. Approximately 1000+ instances/sec will be created. </p>
  
  <p>Is it OK to use Gson instance as static field?</p>
  
  <p>Thanks for any advices/corrections.</p>