### Question:
ContinuationTransactionMap { public boolean putContinuationForDevice(User user, Device device, T continuation) { return continuations.put(new Key(user, device), continuation) != null; } @Inject @VisibleForTesting  ContinuationTransactionMap(); T getContinuationForDevice(User user, Device device); boolean putContinuationForDevice(User user, Device device, T continuation); void delete(User user, Device device);  }### Answer:
@Test public void testPutContinuationForDevice() { TestingContinuation expectedContinuation = new TestingContinuation(); testee.putContinuationForDevice(user, device, expectedContinuation); boolean hasPreviousElement = testee.putContinuationForDevice(user, device, expectedContinuation); assertThat(hasPreviousElement).isTrue(); }
@Test public void testPutContinuationForDeviceButDifferentUser() { TestingContinuation expectedContinuation = new TestingContinuation(); testee.putContinuationForDevice(user, device, expectedContinuation); User blum = User.builder().email("leon.blum@sfio.fr").domain("sfio.fr").login("bblum").build(); boolean hasPreviousElement = testee.putContinuationForDevice(blum, device, expectedContinuation); assertThat(hasPreviousElement).isFalse(); }
@Test public void testPutContinuationForDeviceNoCachedElement() { TestingContinuation expectedContinuation = new TestingContinuation(); boolean hasPreviousElement = testee.putContinuationForDevice(user, device, expectedContinuation); assertThat(hasPreviousElement).isFalse(); }