source: class AddressObserverTest {
  
  	@Mock
  	private HostMonitor hostMonitor;
  	@Mock
  	private NotificationService notificationService;
  	private AddressObserver addressObserver;
  
  	@Test
  	public void testOnIpv6PacketReceived() {
  
target: 		Ipv6PacketReceived packetReceived = mock(Ipv6PacketReceived.class);
  		List<PacketChain> packetChains = new ArrayList<PacketChain>();
  
  		PacketChain packetChain1 = mock(PacketChain.class);
  		PacketChain packetChain2 = mock(PacketChain.class);
  		PacketChain packetChain3 = mock(PacketChain.class);
  
  		packetChains.add(packetChain1);
  		packetChains.add(packetChain2);
  		packetChains.add(packetChain3);
  
  		RawPacket rawPacket = mock(RawPacket.class);
  		EthernetPacket ethernetPacket = mock(EthernetPacket.class);
  		Ipv6Packet ipv6Packet = mock(Ipv6Packet.class);
  		Ipv6Address ipv6Address = Ipv6Address.getDefaultInstance("2000::1");
  		MacAddress srcMac = MacAddress.getDefaultInstance("aa:bb:cc:dd:ee:f0");
  
  		List<Header8021q> headers = mock(ArrayList.class);
  		Header8021q header = mock(Header8021q.class);
  		headers.add(0, header);
  		VlanId vlanId = VlanId.getDefaultInstance("3001");
  		InstanceIdentifier<NodeConnector> ncRefInstance = mock(InstanceIdentifier.class);
  		NodeConnectorRef ncRef = new NodeConnectorRef(ncRefInstance);
  
  		when(packetReceived.getPacketChain()).thenReturn(packetChains);
  		when(packetChain1.getPacket()).thenReturn(rawPacket);
  		when(packetChain2.getPacket()).thenReturn(ethernetPacket);
  		when(packetChain3.getPacket()).thenReturn(ipv6Packet);
  		when(ipv6Packet.getSourceIpv6()).thenReturn(ipv6Address);
  		when(ethernetPacket.getEthertype()).thenReturn(KnownEtherType.VlanTagged);
  		when(ethernetPacket.getHeader8021q()).thenReturn(headers);
  		when(headers.get(anyInt())).thenReturn(header);
  		when(header.getVlan()).thenReturn(vlanId);
  		when(ethernetPacket.getSourceMac()).thenReturn(srcMac);
  		when(rawPacket.getIngress()).thenReturn(ncRef);
  
  		addressObserver.onIpv6PacketReceived(packetReceived);
  
  		verify(hostMonitor, times(1)).packetReceived(any(ConnectorAddress.class), any(InstanceIdentifier.class));
  	}
  
  }