public void testSyncEntity() {
Date d1 = new Date();
Date d2 = new Date(0);
Entity e1 = new Entity(1L, (short)2, 3, 4L, 5, d1);
e1.setActiveSince(d2);
SyncEntity se1 = new SyncEntity(e1);
assertEntityEquals(e1, se1);
assertEquals(1L, se1.macAddress);
assertEquals(Short.valueOf((short)2), se1.vlan);
assertEquals(Integer.valueOf(3), se1.ipv4Address);
assertEquals(Long.valueOf(4L), se1.switchDPID);
assertEquals(Integer.valueOf(5), se1.switchPort);
assertEquals(d1, se1.lastSeenTimestamp);
assertEquals(d2, se1.activeSince);
assertNotSame(d1, se1.lastSeenTimestamp);
assertNotSame(d2, se1.activeSince);
Entity e2 = new Entity(42L, null, null, null, null, null);
SyncEntity se2 = new SyncEntity(e2);
assertEntityEquals(e2, se2);
SyncEntity se3 = new SyncEntity();
SyncEntity se4 = new SyncEntity();
se3.lastSeenTimestamp = new Date(1000);
se4.lastSeenTimestamp = new Date(2000);
assertTrue("", se3.compareTo(se4) < 0);
assertTrue("", se4.compareTo(se3) > 0);
se4.lastSeenTimestamp = new Date(1000);
assertTrue("", se3.compareTo(se4) == 0);
assertTrue("", se4.compareTo(se3) == 0);
se4.lastSeenTimestamp = new Date(500);
assertTrue("", se3.compareTo(se4) > 0);
assertTrue("", se4.compareTo(se3) < 0);
}