### Question:
OmemoService implements OmemoCarbonCopyStanzaReceivedListener, OmemoMessageStanzaReceivedListener { static boolean isStale(OmemoDevice userDevice, OmemoDevice subject, Date lastReceipt, int maxAgeHours) { if (userDevice.equals(subject)) { return false; } if (lastReceipt == null) { return false; } long maxAgeMillis = MILLIS_PER_HOUR * maxAgeHours; Date now = new Date(); return now.getTime() - lastReceipt.getTime() > maxAgeMillis; } protected  OmemoService(); static OmemoService<?, ?, ?, ?, ?, ?, ?, ?, ?> getInstance(); static boolean isServiceRegistered(); OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> getOmemoStoreBackend(); @SuppressWarnings("unused") void setOmemoStoreBackend(
            OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> omemoStore); @Override void onOmemoCarbonCopyReceived(CarbonExtension.Direction direction,
                                          Message carbonCopy,
                                          Message wrappingMessage,
                                          OmemoManager.LoggedInOmemoManager managerGuard); @Override void onOmemoMessageStanzaReceived(Stanza stanza, OmemoManager.LoggedInOmemoManager managerGuard); void purgeDeviceList(OmemoManager.LoggedInOmemoManager managerGuard);  }### Answer:
@Test public void isStaleDeviceTest() throws XmppStringprepException { OmemoDevice user = new OmemoDevice(JidCreate.bareFrom("alice@wonderland.lit"), 123); OmemoDevice other = new OmemoDevice(JidCreate.bareFrom("bob@builder.tv"), 444); Date now = new Date(); Date deleteMe = new Date(now.getTime() - ((DELETE_STALE + 1) * ONE_HOUR)); assertTrue(OmemoService.isStale(user, other, deleteMe, DELETE_STALE)); assertFalse(OmemoService.isStale(user, user, deleteMe, DELETE_STALE)); assertFalse(OmemoService.isStale(user, other, null, DELETE_STALE)); }