private static void verifyDevice(IDevice d,long mac,Short vlan,Integer ip,long swId,int port){
  assertNotNull(d);
  assertEquals(mac,d.getMACAddress());
  if (vlan == null)   assertArrayEquals(new Short[0],d.getVlanId());
 else   assertArrayEquals(new Short[]{vlan},d.getVlanId());
  if (ip == null)   assertArrayEquals(new Integer[0],d.getIPv4Addresses());
 else   assertArrayEquals(new Integer[]{ip},d.getIPv4Addresses());
  SwitchPort expectedAp=new SwitchPort(swId,port);
  assertArrayEquals(new SwitchPort[]{expectedAp},d.getAttachmentPoints());
}

private static void verifyDevice ( IDevice d , long mac , Short vlan , Integer ip , long swId , int port ) { assertNotNull ( d ) ; assertEquals ( mac , d . getMACAddress ( ) ) ; if ( vlan == null ) assertArrayEquals ( new Short [ 0 ] , d . getVlanId ( ) ) ; else assertArrayEquals ( new Short [ ] { vlan } , d . getVlanId ( ) ) ; if ( ip == null ) assertArrayEquals ( new Integer [ 0 ] , d . getIPv4Addresses ( ) ) ; else assertArrayEquals ( new Integer [ ] { ip } , d . getIPv4Addresses ( ) ) ; SwitchPort expectedAp = new SwitchPort ( swId , port ) ; assertArrayEquals ( new SwitchPort [ ] { expectedAp } , d . getAttachmentPoints ( ) ) ; }
verify that the given device exactly matches the given fields . e . g . , if ip is not null we expect the device to have exactly one ip address . swid and port are the attachment point port . vlan and ip are optional all other fields must be specified .
