}
@Test
public static void testEquality() throws Exception {
TestUnion union = new TestUnion(TestUnion.I32_FIELD, 25);
TestUnion otherUnion = new TestUnion(TestUnion.STRING_FIELD, "blah!!!");
if (union.equals(otherUnion)) {
throw new RuntimeException("shouldn't be equal");
}
otherUnion = new TestUnion(TestUnion.I32_FIELD, 400);
if (union.equals(otherUnion)) {
throw new RuntimeException("shouldn't be equal");
}
otherUnion = new TestUnion(TestUnion.OTHER_I32_FIELD, 25);
if (union.equals(otherUnion)) {
throw new RuntimeException("shouldn't be equal");
}
}