Skip to content

Commit

Permalink
Fix some rawtypes in com.google.common.cache.
Browse files Browse the repository at this point in the history
RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=256201831
  • Loading branch information
kluever authored and ronshapiro committed Jul 8, 2019
1 parent 558321c commit 310de86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,15 @@ public void testValues_populated() {
}
}

@SuppressWarnings("unchecked") // generic array creation

public void testEntrySet_populated() {
for (LoadingCache<Object, Object> cache : caches()) {
Set<Entry<Object, Object>> entries = cache.asMap().entrySet();
List<Entry<Object, Object>> warmed = warmUp(cache, WARMUP_MIN, WARMUP_MAX);

Set<?> expected = Maps.newHashMap(cache.asMap()).entrySet();
assertThat(entries).containsExactlyElementsIn((Collection<Entry<Object, Object>>) expected);
assertThat(entries.toArray())
.asList()
.containsExactlyElementsIn((Collection<Object>) expected);
assertThat(entries.toArray(new Entry[0]))
.asList()
.containsExactlyElementsIn((Collection<Entry>) expected);
assertThat(entries).containsExactlyElementsIn(expected);
assertThat(entries.toArray()).asList().containsExactlyElementsIn(expected);
assertThat(entries.toArray(new Object[0])).asList().containsExactlyElementsIn(expected);

new EqualsTester()
.addEqualityGroup(cache.asMap().entrySet(), entries)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,15 @@ public void testValues_populated() {
}
}

@SuppressWarnings("unchecked") // generic array creation

public void testEntrySet_populated() {
for (LoadingCache<Object, Object> cache : caches()) {
Set<Entry<Object, Object>> entries = cache.asMap().entrySet();
List<Entry<Object, Object>> warmed = warmUp(cache, WARMUP_MIN, WARMUP_MAX);

Set<?> expected = Maps.newHashMap(cache.asMap()).entrySet();
assertThat(entries).containsExactlyElementsIn((Collection<Entry<Object, Object>>) expected);
assertThat(entries.toArray())
.asList()
.containsExactlyElementsIn((Collection<Object>) expected);
assertThat(entries.toArray(new Entry[0]))
.asList()
.containsExactlyElementsIn((Collection<Entry>) expected);
assertThat(entries).containsExactlyElementsIn(expected);
assertThat(entries.toArray()).asList().containsExactlyElementsIn(expected);
assertThat(entries.toArray(new Object[0])).asList().containsExactlyElementsIn(expected);

new EqualsTester()
.addEqualityGroup(cache.asMap().entrySet(), entries)
Expand Down

0 comments on commit 310de86

Please sign in to comment.