@Test public void testEquality() { DeviceId deviceId1 = DeviceId.deviceId("of:0001"); DeviceId deviceId2 = DeviceId.deviceId("of:0002"); long apply = 2; ImmutableSet<LabelResource> releaseCollection = ImmutableSet .copyOf(Collections.emptySet()); LabelResourceRequest h1 = new LabelResourceRequest( deviceId1, LabelResourceRequest.Type.APPLY, apply, null); LabelResourceRequest h2 = new LabelResourceRequest( deviceId1, LabelResourceRequest.Type.APPLY, apply, null); LabelResourceRequest h3 = new LabelResourceRequest( deviceId2, LabelResourceRequest.Type.RELEASE, 0, releaseCollection); LabelResourceRequest h4 = new LabelResourceRequest( deviceId2, LabelResourceRequest.Type.RELEASE, 0, releaseCollection); new EqualsTester().addEqualityGroup(h1, h2).addEqualityGroup(h3, h4) .testEquals(); }
public DeviceId deviceId() { return deviceId; }
LabelResourceRequest { public DeviceId deviceId() { return deviceId; } }
LabelResourceRequest { public DeviceId deviceId() { return deviceId; } LabelResourceRequest(DeviceId deviceId,
                                Type type,
                                long applyNum,
                                ImmutableSet<LabelResource> releaseCollection); }
LabelResourceRequest { public DeviceId deviceId() { return deviceId; } LabelResourceRequest(DeviceId deviceId,
                                Type type,
                                long applyNum,
                                ImmutableSet<LabelResource> releaseCollection); DeviceId deviceId(); Type type(); long applyNum(); Collection<LabelResource> releaseCollection(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
LabelResourceRequest { public DeviceId deviceId() { return deviceId; } LabelResourceRequest(DeviceId deviceId,
                                Type type,
                                long applyNum,
                                ImmutableSet<LabelResource> releaseCollection); DeviceId deviceId(); Type type(); long applyNum(); Collection<LabelResource> releaseCollection(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }