<dependency> <groupId>com.google.truth</groupId> <artifactId>truth</artifactId> <version>1.1</version> <scope>test</scope> </dependency> import com.google.common.collect.ImmutableList; import com.google.common.truth.Truth; import org.junit.Test; public class ExampleTest { @Test public void testListEquality() { ImmutableList<String> list1 = ImmutableList.of("apple", "banana", "cherry"); ImmutableList<String> list2 = ImmutableList.of("apple", "banana", "cherry"); Truth.assertThat(list1).isEqualTo(list2); } }


上一篇:
下一篇:
切换中文