CassandraRegisterStore extends NoSqlDatabaseRegisterStore { @Override public boolean isExisting(Endpoint addr, Contact contact) { return queryResult(addr, contact.getEndpoint()) != null; }  @Override void init(Map<String, String> props); @Override void add(Endpoint addr, Contact contact); @Override void update(Endpoint addr, Contact contact); @Override void remove(Endpoint addr, Contact contact); @Override void remove(Endpoint addr); @Override Collection<Contact> getContacts(Endpoint addr); @Override Iterator<Endpoint> getEndpoints(); @Override Contact getContact(Endpoint addr, Endpoint contact); @Override boolean isExisting(Endpoint addr, Contact contact); @Override boolean isExisting(Endpoint addr); @Override void destroy();  }
@Test public void testIsExisting() { MockEndPoint endPoint1 = new MockEndPoint("sip:test1@voxeo.com"); MockEndPoint endPoint2 = new MockEndPoint("sip:Alex@voxeo.com"); MockContact mockContact1 = new MockContact("sip:test1@127.0.0.1"); MockContact mockContact3 = new MockContact("sip:test1@172.21.0.191"); MockContact mockContact2 = new MockContact("sip:alex@172.21.0.193"); _cassandraRegisterStore.add(endPoint1, mockContact1); _cassandraRegisterStore.add(endPoint1, mockContact3); _cassandraRegisterStore.add(endPoint2, mockContact2); assertTrue(_cassandraRegisterStore.isExisting(endPoint1, mockContact1)); assertTrue(_cassandraRegisterStore.isExisting(endPoint1)); }