package com.braintreepayments.api;

import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;

import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class Utils {
    private Utils() {
        throw new IllegalStateException("Non-instantiable class.");
    }

    private static Gson gson;

    public static Gson getGson() {
        if (gson == null) {
            gson = new GsonBuilder()
                    .addSerializationExclusionStrategy(new ExclusionStrategy() {
                        @Override
                        public boolean shouldSkipField(FieldAttributes fieldAttributes) {
                            final Expose expose = fieldAttributes.getAnnotation(Expose.class);
                            return expose != null && !expose.serialize();
                        }

                        @Override
                        public boolean shouldSkipClass(Class<?> aClass) {
                            return false;
                        }
                    })
                    .addDeserializationExclusionStrategy(new ExclusionStrategy() {
                        @Override
                        public boolean shouldSkipField(FieldAttributes fieldAttributes) {
                            final Expose expose = fieldAttributes.getAnnotation(Expose.class);
                            return expose != null && !expose.deserialize();
                        }

                        @Override
                        public boolean shouldSkipClass(Class<?> aClass) {
                            return false;
                        }
                    })
                    .create();
        }

        return gson;
    }

    protected static <K, V> Map<K, V> newHashMap() {
        return new HashMap<K, V>();
    }

    protected static <T> Set<T> newHashSet() {
        return new HashSet<T>();
    }

    protected static <T> List<T> newLinkedList() {
        return new LinkedList<T>();
    }
}

@@ -224,34 +224,8 @@
 e;%0A%0A
-import java.util.HashMap;%0A
 impo
@@ -302,30 +302,8 @@
 st;%0A
-import java.util.Map;%0A
 impo
@@ -1848,104 +1848,8 @@
  %7D%0A%0A
-    protected static %3CK, V%3E Map%3CK, V%3E newHashMap() %7B%0A        return new HashMap%3CK, V%3E();%0A    %7D%0A%0A
     

Remove unused method