title: Error: Cannot use unbound generics in Type Converters
body: <p>I'm Using Room to do data persistence, What I want to to is to Have two methods</p>
  
  <p>called <code>stringToObject(String data)</code> to </p>
  
  <p>handle all the Type Converting for multiple classes </p>
  
  <p>like: <code>MoviesList</code> &amp; <code>ReviewList</code>&amp;<code>TrailerList</code></p>
  
  <p>when I run the App I get this error : </p>
  
  <blockquote>
    <p>error: Cannot use unbound generics in Type Converters.</p>
  </blockquote>
  
  <pre><code>public class Converters{
  public static Gson gson = new Gson();
  
  @TypeConverter
  public static &lt;T&gt; List&lt;T&gt; stringToObject(String data) {
      if (data == null) {
          return Collections.emptyList();
      }
  
      Type listType = new TypeToken&lt;List&lt;T&gt;&gt;(){}.getType();
  
      return gson.fromJson(data, listType);
  }
  
  @TypeConverter
  public static &lt;T&gt;  String ObjectToString(List&lt;T&gt; someObjects) {
        return gson.toJson(someObjects);
      } 
  }
  </code></pre>
  
  <hr>
  
  <pre><code>public class ReviewList {
  
  @SerializedName("id")
  private Integer id;
  @SerializedName("page")
  private Integer page;
  @SerializedName("results")
  private List&lt;Review&gt; reviewList = null;
  @SerializedName("total_pages")
  private Integer totalPages;
  @SerializedName("total_results")
  private Integer totalResults;
  
  public Integer getId() {
      return id;
  }
  
  public void setId(Integer id) {
      this.id = id;
  }
  
  public Integer getPage() {
      return page;
  }
  
  public void setPage(Integer page) {
      this.page = page;
  }
  
  public List&lt;Review&gt; getReviewList() {
      return reviewList;
  }
  
  public void setReviewList(List&lt;Review&gt; reviewList) {
      this.reviewList = reviewList;
  }
  
  ....
  </code></pre>
  
  <p>}</p>
  
  <hr>
  
  <pre><code>public class TrailerList {
  
  @SerializedName("id")
  private Integer id;
  @SerializedName("results")
  private List&lt;Trailer&gt; trailers = null;
  
  public List&lt;Trailer&gt; getTrailers() {
      return trailers;
  }
  
  public void setTrailers(List&lt;Trailer&gt; trailers) {
      this.trailers = trailers;
  }
  
  ....
  </code></pre>
  
  <p>What is Cussing The Error ?</p>
  
  <p>How Can I fix it ?</p>