@Test public void diff_includes_contextless_and_context_matching_changesets() { Collection<Changeset> changesets = diffMaker.computeChangesetsToInsert( new ExecutionContexts(Arrays.asList("foo", "bar")), Arrays.asList( changeset("ID", "fbiville", "CREATE n"), changeset("ID2", "fbiville", "CREATE m", "bar"), changeset("ID3", "fbiville", "CREATE l", "foo"), changeset("ID4", "fbiville", "CREATE k", "foo,baz"), changeset("ID5", "fbiville", "CREATE j", "baz"), changeset("ID6", "fbiville", "CREATE i", "foo,bar"), changeset("ID7", "fbiville", "CREATE h") ), singletonList(changeset("ID", "fbiville", "CREATE n")) ); assertThat(changesets) .extracting("id") .containsExactly("ID2", "ID3", "ID4", "ID6", "ID7"); }
public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); }
ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); } }
ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); }  }
ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); }  Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts,
                                                           Collection<Changeset> declaredChangesets,
                                                           Collection<Changeset> persistedChangesets); }
ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); }  Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts,
                                                           Collection<Changeset> declaredChangesets,
                                                           Collection<Changeset> persistedChangesets);  }