public static <S, T extends Serializable> Map<S, ArrayList<T>> makeValuesSerializable(
      Map<S, Collection<T>> map) {
    return Maps.transformValues(map, new Function<Collection<T>, ArrayList<T>>() {
      @Override
      public ArrayList<T> apply(Collection<T> input) {
        return new ArrayList<>(input);
      }
    });
  }
public static < S , T extends Serializable > Map < S , ArrayList < T > > makeValuesSerializable ( Map < S , Collection < T > > map ) { return Maps . transformValues ( map , new Function < Collection < T > , ArrayList < T > > ( ) { @ Override public ArrayList < T > apply ( Collection < T > input ) { return new ArrayList < > ( input ) ; } } ) ; }
@param <S> the key type for the Map
@param <T> the type of the values in the collections which are the values for the Map
@param map a map to make serializable
@return a copy of the map with serializable values