### Question:
LiveDataResponseBodyConverterFactory extends Converter.Factory { @Nullable @Override public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; if (parameterizedType.getRawType() == Response.class) { Type subType = parameterizedType.getActualTypeArguments()[0]; if (subType instanceof ParameterizedType) { parameterizedType = (ParameterizedType) parameterizedType.getActualTypeArguments()[0]; } } if (parameterizedType.getRawType() == Resource.class) { Type realType = parameterizedType.getActualTypeArguments()[0]; return retrofit.nextResponseBodyConverter(this, realType, annotations); } } return retrofit.nextResponseBodyConverter(this, type, annotations); } private  LiveDataResponseBodyConverterFactory(); static LiveDataResponseBodyConverterFactory create(); static LiveDataResponseBodyConverterFactory wrap(Converter.Factory factory); @Nullable @Override Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
                                                            Retrofit retrofit);  }### Answer:
@Test public void responseTypeReturnsStringConverterFactory() { Type responseType = new TypeToken<Response<Resource<String>>>() {}.getType(); Converter<ResponseBody, ?> converter = factory .responseBodyConverter(responseType, NO_ANNOTATIONS, retrofit); assertThat(converter).isInstanceOf(StringConverterFactory.StringResponseBodyConverter.class); }
@Test public void bodyTypeReturnsStringConverterFactory() { Type responseType = new TypeToken<Resource<String>>() {}.getType(); Converter<ResponseBody, ?> converter = factory .responseBodyConverter(responseType, NO_ANNOTATIONS, retrofit); assertThat(converter).isInstanceOf(StringConverterFactory.StringResponseBodyConverter.class); }
@Test public void anyOtherTypeReturnsStringConverterFactory() { Type responseType = new TypeToken<String>() {}.getType(); Converter<ResponseBody, ?> converter = factory .responseBodyConverter(responseType, NO_ANNOTATIONS, retrofit); assertThat(converter).isInstanceOf(StringConverterFactory.StringResponseBodyConverter.class); }