package com.github.vbauer.yta.service.transport.impl;

import com.github.vbauer.yta.service.transport.DataConverter;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapterFactory;

import javax.annotation.concurrent.ThreadSafe;
import java.util.ServiceLoader;

/**
` * See {@link DataConverter}.
 *
 * @author Vladislav Bauer
 */

@ThreadSafe
public class DataConverterImpl implements DataConverter {

    private static final Gson CONVERTER = createConverter();


    /**
     * {@inheritDoc}
     */
    @Override
    public <T> T convert(final String data, final Class<T> targetClass) {
        return CONVERTER.fromJson(data, targetClass);
    }


    private static Gson createConverter() {
        final GsonBuilder builder = new GsonBuilder();
        ServiceLoader.load(TypeAdapterFactory.class).forEach(builder::registerTypeAdapterFactory);
        return builder.create();
    }

}

@@ -785,24 +785,92 @@
 nBuilder();%0A
+        final ServiceLoader%3CTypeAdapterFactory%3E serviceLoader =%0A    
         Serv
@@ -909,16 +909,40 @@
 y.class)
+;%0A%0A        serviceLoader
 .forEach
@@ -980,16 +980,17 @@
 ctory);%0A
+%0A
         

Make `DataConverterImpl` a little bit "debugable"