PeerManagerImpl implements PeerManager, HeartbeatListener { @Override public List<Peer> getPeers() { return new ArrayList<>( this.peers.values() ); } PeerManagerImpl( final Messenger messenger, LocalPeer localPeer, DaoManager daoManager,
                            MessageResponseListener messageResponseListener, SecurityManager securityManager,
                            IdentityManager identityManager, Object provider ); void init(); void destroy(); void setRelationManager( final RelationManager relationManager ); @Override void registerPeerActionListener( PeerActionListener peerActionListener ); @Override void unregisterPeerActionListener( PeerActionListener peerActionListener ); @RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } ) @Override void setName( final String peerId, final String newName ); @RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } ) @Override void updatePeerUrl( final String peerId, final String ip ); @Override List<Peer> getPeers(); @Override Set<Peer> resolve( final Set<String> peers ); @Override Peer getPeer( final String peerId ); @Override RemotePeer findPeer( final String peerId ); @Override LocalPeer getLocalPeer(); @RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } ) @Override RegistrationData processRegistrationRequest( final RegistrationData registrationData ); @RolesAllowed( { "Peer-Management|Delete", "Peer-Management|Update" } ) @Override void processUnregisterRequest( final RegistrationData registrationData ); @RolesAllowed( { "Peer-Management|Delete", "Peer-Management|Update" } ) @Override void processRejectRequest( final RegistrationData registrationData ); @RolesAllowed( { "Peer-Management|Delete", "Peer-Management|Update" } ) @Override void processCancelRequest( final RegistrationData registrationData ); @RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } ) @Override void processApproveRequest( final RegistrationData registrationData ); @RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } ) @Override void doRegistrationRequest( final String destinationHost, final String keyPhrase ); @RolesAllowed( { "Peer-Management|Read" } ) @Override void checkHostAvailability( final String destinationHost ); @RolesAllowed( { "Peer-Management|Delete", "Peer-Management|Update" } ) @Override void doCancelRequest( final String peerId, boolean forceAction ); @RolesAllowed( { "Peer-Management|Write", "Peer-Management|Update" } ) @Override void doApproveRequest( final String keyPhrase, final String peerId ); @RolesAllowed( { "Peer-Management|Delete", "Peer-Management|Update" } ) @Override void doRejectRequest( final String peerId, boolean forceAction ); @RolesAllowed( { "Peer-Management|Delete", "Peer-Management|Update" } ) @Override void doUnregisterRequest( final String peerId, boolean forceAction ); @Override List<RegistrationData> getRegistrationRequests(); @Override String getRemotePeerIdByIp( final String ip ); @Override PeerPolicy getAvailablePolicy(); @Override RegistrationStatus getRegistrationStatus( String peerId ); @Override RegistrationStatus getRemoteRegistrationStatus( String peerId ); @Override PeerPolicy getPolicy( final String peerId ); @Override void setPolicy( String peerId, PeerPolicy peerPolicy ); @Override void setPublicUrl( final String peerId, final String publicUrl, final int securePort, boolean useRhIp ); @Override void onHeartbeat( final HeartBeat heartBeat );  }
@Test public void testGetPeers() throws Exception { List<Peer> peers = peerManager.getPeers(); assertTrue( peers.contains( localPeer ) ); }