JdbcAddressRepository extends JdbcHelper implements AddressRepository { @Override public List<BitmessageAddress> getContacts() { return find("private_key IS NULL OR chan = '1'"); } JdbcAddressRepository(JdbcConfig config); @Override BitmessageAddress findContact(byte[] ripeOrTag); @Override BitmessageAddress findIdentity(byte[] ripeOrTag); @Override List<BitmessageAddress> getIdentities(); @Override List<BitmessageAddress> getChans(); @Override List<BitmessageAddress> getSubscriptions(); @Override List<BitmessageAddress> getSubscriptions(long broadcastVersion); @Override List<BitmessageAddress> getContacts(); @Override void save(BitmessageAddress address); @Override void remove(BitmessageAddress address); @Override BitmessageAddress getAddress(String address);  }
@Test public void testGetContacts() throws Exception { List<BitmessageAddress> contacts = repo.getContacts(); assertEquals(3, contacts.size()); for (BitmessageAddress contact : contacts) { assertNull(contact.getPrivateKey()); } }