File tree Expand file tree Collapse file tree
assertj/src/test/java/com/baeldung/assertj/introduction Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import com .google .common .base .Optional ;
44import com .google .common .collect .HashBasedTable ;
5- import com .google .common .collect .ImmutableMap ;
5+ import com .google .common .collect .Multimap ;
66import com .google .common .collect .Multimaps ;
77import com .google .common .collect .Range ;
8- import com .google .common .collect .SetMultimap ;
8+ import com .google .common .collect .Sets ;
99import com .google .common .collect .TreeRangeMap ;
1010import com .google .common .io .Files ;
1111import org .assertj .guava .data .MapEntry ;
1212import org .junit .Test ;
1313
1414import java .io .File ;
15+ import java .util .HashMap ;
1516
1617import static org .assertj .guava .api .Assertions .assertThat ;
1718import static org .assertj .guava .api .Assertions .entry ;
@@ -30,12 +31,15 @@ public void givenTwoEmptyFiles_whenComparingContent_thenEqual() throws Exception
3031
3132 @ Test
3233 public void givenMultimap_whenVerifying_thenCorrect () throws Exception {
33- final SetMultimap <Object , Object > mmap = Multimaps .forMap (ImmutableMap .of (1 , "one" ));
34+ final Multimap <Integer , String > mmap = Multimaps .newMultimap (new HashMap <>(), Sets ::newHashSet );
35+ mmap .put (1 , "one" );
36+ mmap .put (1 , "1" );
3437
3538 assertThat (mmap )
36- .hasSize (1 )
39+ .hasSize (2 )
3740 .containsKeys (1 )
38- .contains (entry (1 , "one" ));
41+ .contains (entry (1 , "one" ))
42+ .contains (entry (1 , "1" ));
3943 }
4044
4145 @ Test
You can’t perform that action at this time.
0 commit comments