@Test public void doesntCacheSimpleObjectsOfAddToListAndReplaceInListCommands() { when(listVersions.getMetaDataOrFail(EXEMPLARY_LIST_ID)).thenReturn(new ListPropertyMetaData(null, randomUUID())) .thenReturn(new ListPropertyMetaData(null, randomUUID())); final AddToList addCommandWithSimpleObject = new AddToList(EXEMPLARY_LIST_ID, new ListVersionChange(randomUUID(), randomUUID()), new Value("some simple object"), 6); final ReplaceInList replaceCommandWithSimpleObject = new ReplaceInList(EXEMPLARY_LIST_ID, new ListVersionChange(randomUUID(), randomUUID()), new Value("other simple object"), 7); cut.execute(addCommandWithSimpleObject); cut.execute(replaceCommandWithSimpleObject); verify(referenceKeeper, never()).keepReferenceTo(any()); verifyNoMoreInteractions(objectRegistry, executor); }
@Override public void execute(final AddToList command) { referenceKeeper.cleanReferenceCache(); if (couldBeExecuted(command)) { executor.execute(command); } else { keepReferenceIfObservable(command.getValue()); } }
ListPropertyCommandFilter implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { referenceKeeper.cleanReferenceCache(); if (couldBeExecuted(command)) { executor.execute(command); } else { keepReferenceIfObservable(command.getValue()); } } }
ListPropertyCommandFilter implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { referenceKeeper.cleanReferenceCache(); if (couldBeExecuted(command)) { executor.execute(command); } else { keepReferenceIfObservable(command.getValue()); } } ListPropertyCommandFilter(final ListPropertyCommandExecutor executor,
            final TemporaryReferenceKeeper referenceKeeper, final ListPropertyMetaDataStore listVersions,
            final WeakObjectRegistry objectRegistry, final boolean useLocalVerision); }
ListPropertyCommandFilter implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { referenceKeeper.cleanReferenceCache(); if (couldBeExecuted(command)) { executor.execute(command); } else { keepReferenceIfObservable(command.getValue()); } } ListPropertyCommandFilter(final ListPropertyCommandExecutor executor,
            final TemporaryReferenceKeeper referenceKeeper, final ListPropertyMetaDataStore listVersions,
            final WeakObjectRegistry objectRegistry, final boolean useLocalVerision); @Override void execute(final AddToList command); @Override void execute(final RemoveFromList command); @Override void execute(final ReplaceInList command); }
ListPropertyCommandFilter implements ListPropertyCommandExecutor { @Override public void execute(final AddToList command) { referenceKeeper.cleanReferenceCache(); if (couldBeExecuted(command)) { executor.execute(command); } else { keepReferenceIfObservable(command.getValue()); } } ListPropertyCommandFilter(final ListPropertyCommandExecutor executor,
            final TemporaryReferenceKeeper referenceKeeper, final ListPropertyMetaDataStore listVersions,
            final WeakObjectRegistry objectRegistry, final boolean useLocalVerision); @Override void execute(final AddToList command); @Override void execute(final RemoveFromList command); @Override void execute(final ReplaceInList command);  }