@Test public void merge_revisions() { SimpleVersion v1 = new Builder() .branch("branch1") .changeset(ImmutableMap.of("key","value1", "foo","bar")) .build(); SimpleVersion v2 = new Builder() .branch("branch2") .changeset(ImmutableMap.of("key", "value2", "bar", "foo")) .build(); SimpleVersionGraph versionGraph = init(asList(v1, v2)); Merge<String, String, String> merge = versionGraph.mergeRevisions(v1.revision, v2.revision); assertThat(merge.getProperties()).isEqualTo(ImmutableMap.of("key","value2", "foo","bar", "bar","foo")); assertThat(merge.conflicts.entries()).hasSize(1); assertThat(merge.getProperties()) .withFailMessage("Order doesn't matter") .isEqualTo(versionGraph.mergeRevisions(v2.revision, v1.revision).getProperties()); }
public static SimpleVersionGraph init() { return new SimpleVersionGraph(); }
SimpleVersionGraph extends AbstractVersionGraph<String, String, String, SimpleVersionGraph, SimpleVersionGraph.Builder> { public static SimpleVersionGraph init() { return new SimpleVersionGraph(); } }
SimpleVersionGraph extends AbstractVersionGraph<String, String, String, SimpleVersionGraph, SimpleVersionGraph.Builder> { public static SimpleVersionGraph init() { return new SimpleVersionGraph(); } private  SimpleVersionGraph(); private  SimpleVersionGraph(Builder builder); }
SimpleVersionGraph extends AbstractVersionGraph<String, String, String, SimpleVersionGraph, SimpleVersionGraph.Builder> { public static SimpleVersionGraph init() { return new SimpleVersionGraph(); } private  SimpleVersionGraph(); private  SimpleVersionGraph(Builder builder); static SimpleVersionGraph init(); static SimpleVersionGraph init(Version<String, String, String>... versions); static SimpleVersionGraph init(Iterable<? extends Version<String, String, String>> versions); }
SimpleVersionGraph extends AbstractVersionGraph<String, String, String, SimpleVersionGraph, SimpleVersionGraph.Builder> { public static SimpleVersionGraph init() { return new SimpleVersionGraph(); } private  SimpleVersionGraph(); private  SimpleVersionGraph(Builder builder); static SimpleVersionGraph init(); static SimpleVersionGraph init(Version<String, String, String>... versions); static SimpleVersionGraph init(Iterable<? extends Version<String, String, String>> versions);  }