Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
mlrprananta authored and rickie committed Nov 8, 2022
1 parent 3297cb6 commit ff9415d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Stream<V> after(Map<K, V> map) {
static final class MapIsEmpty<K, V> {
@BeforeTemplate
boolean before(Map<K, V> map) {
return map.keySet().isEmpty();
return Refaster.anyOf(map.keySet(), map.values(), map.entrySet()).isEmpty();
}

@AfterTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ Stream<Integer> testMapValueStream() {
Stream<boolean> testMapIsEmpty() {
return ImmutableMap.of("foo", 1).entrySet().isEmpty();
}

ImmutableSet<Boolean> testMapIsEmpty() {
return ImmutableSet.of(
ImmutableMap.of("foo", 1).keySet().isEmpty(),
ImmutableMap.of("bar", 2).values().isEmpty(),
ImmutableMap.of("baz", 3).entrySet().isEmpty());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ Stream<Integer> testMapValueStream() {
return ImmutableMap.of("foo", 1).values().stream();
}

Stream<boolean> testMapIsEmpty() {
return ImmutableMap.of("foo", 1).isEmpty();
ImmutableSet<Boolean> testMapIsEmpty() {
return ImmutableSet.of(
ImmutableMap.of("foo", 1).isEmpty(),
ImmutableMap.of("bar", 2).isEmpty(),
ImmutableMap.of("baz", 3).isEmpty());
}
}

0 comments on commit ff9415d

Please sign in to comment.