class BaggageSdk implements Baggage {

  @Override
  public Collection<Entry> getEntries() {
    Map<String, Entry> combined = new HashMap<>(entries);
    if (parent != null) {
      for (Entry entry : parent.getEntries()) {
        if (!combined.containsKey(entry.getKey())) {
          combined.put(entry.getKey(), entry);
        }
      }
    }
    // Clean out any null values that may have been added by Builder.remove.
    for (Iterator<Entry> it = combined.values().iterator(); it.hasNext(); ) {
      if (it.next() == null) {
        it.remove();
      }
    }

    return Collections.unmodifiableCollection(combined.values());
  }

  private  BaggageSdk(Map<String, ? extends Entry> entries, Baggage parent);

}