Skip to content

Commit

Permalink
Prefer Multimap interface types over implementation types.
Browse files Browse the repository at this point in the history
This change is required before the migration to MultimapBuilder can be
completed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141560718
  • Loading branch information
kluever authored and ronshapiro committed Dec 12, 2016
1 parent cea4f68 commit 5bde7b4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public Ordered containsExactly(Multimap<?, ?> expectedMultimap) {
}

private Ordered containsExactly(String failVerb, Multimap<?, ?> expectedMultimap) {
Multimap<?, ?> missing = difference(expectedMultimap, actual());
Multimap<?, ?> extra = difference(actual(), expectedMultimap);
ListMultimap<?, ?> missing = difference(expectedMultimap, actual());
ListMultimap<?, ?> extra = difference(actual(), expectedMultimap);

// TODO(kak): Possible enhancement: Include "[1 copy]" if the element does appear in
// the subject but not enough times. Similarly for unexpected extra items.
Expand Down Expand Up @@ -277,8 +277,8 @@ private static <K, V> Collection<V> get(Multimap<K, V> multimap, @Nullable Objec
}
}

private static Multimap<?, ?> difference(Multimap<?, ?> minuend, Multimap<?, ?> subtrahend) {
LinkedListMultimap<Object, Object> difference = LinkedListMultimap.create();
private static ListMultimap<?, ?> difference(Multimap<?, ?> minuend, Multimap<?, ?> subtrahend) {
ListMultimap<Object, Object> difference = LinkedListMultimap.create();
for (Object key : minuend.keySet()) {
List<?> valDifference =
difference(
Expand Down

0 comments on commit 5bde7b4

Please # to comment.