### Question:
MemoryStore implements Store { @Override public boolean store(SerializableActor actor) { Validate.notNull(actor); Address actorAddr = actor.getSelf(); Validate.isTrue(actorAddr.size() == 2, "Actor address has unexpected number of elements: %s", actorAddr); Validate.isTrue(actorAddr.getElement(0).equals(prefix), "Actor address must start with %s: %s", prefix, actorAddr); Validate.validState(!closed, "Store closed"); if (actor.getCheckpointTimeout() < 0L && actor.getCheckpointPayload() == null) { throw new IllegalStateException("Actor doesn't have checkpoint time/message:" + ' ' + actorAddr + ' ' + actor.getCheckpointTimeout() + ' ' + actor.getCheckpointPayload()); } LockRegion lockRegion = getLockRegion(actorAddr); synchronized (lockRegion) { boolean exists = lockRegion.actors.containsKey(actorAddr); byte[] serializedActor = lockRegion.serializer.serialize(actor); if (!exists) { ActorData actorData = new ActorData(); actorData.msgQueue = new LinkedList<>(); actorData.data = serializedActor; actorData.checkpointInstance = actor.getCheckpointInstance(); actorData.checkpointData = serializedActor; actorData.checkpointTime = calculateCheckpointTime(actor.getCheckpointTimeout()); actorData.checkpointInstance = actor.getCheckpointInstance(); lockRegion.actors.put(actorAddr, actorData); lockRegion.timeouts.add(actorData); lockRegion.actors.put(actorAddr, actorData); } else { ActorData actorData = lockRegion.actors.get(actorAddr); actorData.data = serializedActor; if (actor.getCheckpointInstance() != actorData.checkpointInstance) { LOGGER.warn("Ignoring update for actor with old checkpoint instance: {} vs {} for {}", actorData.checkpointInstance, actor.getCheckpointInstance(), actorAddr); return false; } if (actor.getCheckpointUpdated()) { LOGGER.debug("Checkpoint actor: {}", actorAddr); lockRegion.timeouts.remove(actorData); actorData.checkpointData = serializedActor; actorData.checkpointTime = calculateCheckpointTime(actor.getCheckpointTimeout()); actorData.checkpointInstance = actor.getCheckpointInstance(); lockRegion.timeouts.add(actorData); } if (!actorData.msgQueue.isEmpty()) { lockRegion.availableSet.add(actorAddr); } lockRegion.processingSet.remove(actorAddr); } LOGGER.debug("Stored actor: {} ({})", actorAddr, exists ? "existing" : "new"); return true; } } private  MemoryStore(String prefix, int concurrency); static MemoryStore create(String prefix, int concurrency); @Override boolean store(SerializableActor actor); @Override void store(Collection<Message> messages); @Override void discard(Address address); @Override StoredWork take(); @Override void close(); int getStoredMessageCount(); int getActorCount(); int getProcessingActorCount(); int getReadyActorCount();  }### Answer:
@Test public void mustAllowWhenStoringMessagesWithSourceThatHasAnyPrefix() { fixture.store(new Message("unknown1:a", "actor:b:2:3:4", "payload")); }
@Test public void mustAllowWhenStoringMessagesWithWithSingleElementSource() { fixture.store(new Message("unknown1", "actor:b:2:3:4", "payload")); }
@Test(expected = IllegalArgumentException.class) public void mustFailWhenStoringMessageWithDestinationThatHasBadPrefix() { fixture.store(new Message("unknown1:a", "unknown2:b:2:3:4", "payload")); }