RoutingConfigServiceImpl implements RoutingConfigService, BindingAwareProvider, AutoCloseable { public List<BgpPeer> getBgpPeerFromMap() { List<BgpPeer> bgpPeers = null; if(bgpPeerMap != null) { bgpPeers = new ArrayList<BgpPeer>(); Iterator<BgpPeer> iterator = bgpPeerMap.values().iterator(); while(iterator.hasNext()) { bgpPeers.add(iterator.next()); } } return bgpPeers; } RoutingConfigServiceImpl(DataBroker dataBroker); @Override void onSessionInitiated(ProviderContext session); @Override boolean isIpAddressLocal(IpAddress ipAddress); @Override boolean isIpPrefixLocal(AtriumIpPrefix ipPrefix); @Override void close(); @Override BgpSpeakers getBgpSpeakers(); @Override BgpPeers getBgpPeers(); @Override BgpSpeaker getBgpSpeakerByMac(String mac); @Override BgpPeer getBgpPeerByIpAddress(IpAddress ip); @Override AtriumInterface getInterface(NodeConnector connectPoint); @Override AtriumInterface getMatchingInterface(IpAddress ipAddress); @Override Set<AtriumInterface> getInterfaces(); List<BgpSpeaker> getBgpSpeakerFromMap(); List<BgpPeer> getBgpPeerFromMap();  }
@Test public void testBgpPeers() { List<BgpPeer> bgpPeers = routingConfigService.getBgpPeerFromMap(); assertNotNull(bgpPeers); assertEquals(2, bgpPeers.size()); }