@SuppressWarnings("unchecked") // safe by specification of ListMultimap.asMap()
  @Override
  public Map<String, List<String>> getHeaderFields() {
    try {
      connect();
    } catch (IOException e) {
      return ImmutableMap.of();
    }
    return (ImmutableMap<String, List<String>>) (ImmutableMap<String, ?>) headers.asMap();
  }
{@code URLConnection} implementation.

@author Colin Decker
jimfs/src/main/java/com/google/common/jimfs/PathURLConnection.java