Gson deserialize interface to its Class implementation
<p>I am using <strong>Retrofit 2.1.0</strong> with <strong>converter-gson:2.1.0</strong> and separately <strong>gson:2.6.2</strong> in order to customize the serialization/deserialization. The problem is that my POJOs should be hidden behind interfaces and I want to tell Gson which class should be the deserialized interface. And after the deserialization/ serialization Retrofit should be able to return the interface. It would be good if I can take advantage of Generics and easily create a way to tell Gson or Retrofit to serialize/deserialize FooInterface to FooClass.</p>