aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java
diff options
context:
space:
mode:
authorGravatar brandjon <brandjon@google.com>2017-12-18 13:24:11 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-18 13:26:27 -0800
commitcdbaef24f47f859d8fd431a7844b08ed4e9d8461 (patch)
tree326e0975583f8dbb3e43dbcee5f5461014fa4fe6 /src/test/java
parentba14f67679235af1f261b422a8a0098dabe027f8 (diff)
Make ObjectCodecTester more convenient
Add a safe varargs annotation. Use more precise type signature for ObjectCodecTester#verifyDeserialized and AbstractObjectCodecTest#verifyDeserialization. RELNOTES: None PiperOrigin-RevId: 179460437
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java b/src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java
index f459808bbe..cc71bee36a 100644
--- a/src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java
+++ b/src/test/java/com/google/devtools/build/lib/collect/nestedset/NestedSetCodecTest.java
@@ -59,12 +59,11 @@ public class NestedSetCodecTest {
.buildAndRunTests();
}
- @SuppressWarnings("unchecked")
- private static void verifyDeserialization(NestedSet<String> subject, Object deserialized) {
- NestedSet<String> other = (NestedSet<String>) deserialized;
- assertThat(subject.getOrder()).isEqualTo(other.getOrder());
- assertThat(subject.toSet()).isEqualTo(other.toSet());
- verifyStructure(subject.rawChildren(), other.rawChildren());
+ private static void verifyDeserialization(
+ NestedSet<String> subject, NestedSet<String> deserialized) {
+ assertThat(subject.getOrder()).isEqualTo(deserialized.getOrder());
+ assertThat(subject.toSet()).isEqualTo(deserialized.toSet());
+ verifyStructure(subject.rawChildren(), deserialized.rawChildren());
}
private static void verifyStructure(Object lhs, Object rhs) {