title: Jackson's ObjectMapper, serialize list
body: <p>I wrote simple wrapper around Jackson's <code>ObjectMapper</code> which would convert <code>List&lt;?&gt;</code> to <code>String</code>:</p>
  
  <pre><code>public static &lt;T&gt; String listToString(List&lt;T&gt; list) {
      if (list == null) {
          return null;
      }
      ObjectMapper mapper = new ObjectMapper();
      try {
          return mapper.writeValueAsString(list);
      } catch (JsonProcessingException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
      return null;
  }
  </code></pre>
  
  <p>However, if I pass empty <code>ArrayList</code> there, <code>mapper.writeValueAsString(list)</code> is executed around 2 seconds. I'm testing in debug in eclipse.
  Why is it executed for so much time? What am I doing wrong?</p>