@Test public void mixed_optimizations() { SimpleVersion v1 = SimpleVersion.builder() .changeset(mapOf( "property1", "value1", "property2", "value1")) .build(); SimpleVersion v2 = SimpleVersion.builder() .changeset(mapOf("property2", null)) .parents(v1.revision) .build(); SimpleVersion v3 = SimpleVersion.builder() .parents(v2.revision) .build(); SimpleVersion v4 = SimpleVersion.builder() .changeset(mapOf( "property1", "value2", "property2", "value1")) .parents(v3.revision) .build(); SimpleVersion v5 = SimpleVersion.builder() .changeset(mapOf("property2", "value2")) .parents(v3.revision) .build(); SimpleVersion v6 = SimpleVersion.builder() .parents(v4.revision) .build(); SimpleVersionGraph versionGraph = SimpleVersionGraph.init(v1, v2, v3, v4, v5, v6); versionGraph = versionGraph.optimize(v5.revision, v6.revision).getGraph(); VersionNode<String, String, String> versionNode = versionGraph.getVersionNode(v3.revision); assertThat(versionNode.getParentRevisions()).isEmpty(); assertThat(versionNode.getChangeset()).isEqualTo(mapOf("property1", "value1")); assertThat(versionNode.getProperties()).doesNotContainKey("property2"); versionNode = versionGraph.getVersionNode(v5.revision); assertThat(versionNode.getParentRevisions()).isEqualTo(ImmutableSet.of(v3.revision)); assertThat(versionNode.getChangeset()).isEqualTo(mapOf("property2", "value2")); versionNode = versionGraph.getVersionNode(v6.revision); assertThat(versionNode.getParentRevisions()).isEqualTo(ImmutableSet.of(v3.revision)); assertThat(versionNode.getChangeset()).isEqualTo(mapOf( "property1", "value2", "property2", "value1")); }
public G getGraph() { return graph; }
OptimizedGraph { public G getGraph() { return graph; } }
OptimizedGraph { public G getGraph() { return graph; } OptimizedGraph(G graph, List<Revision> keptRevisions, List<Revision> squashedRevisions); }
OptimizedGraph { public G getGraph() { return graph; } OptimizedGraph(G graph, List<Revision> keptRevisions, List<Revision> squashedRevisions); G getGraph(); List<Revision> getSquashedRevisions(); List<Revision> getKeptRevisions(); }
OptimizedGraph { public G getGraph() { return graph; } OptimizedGraph(G graph, List<Revision> keptRevisions, List<Revision> squashedRevisions); G getGraph(); List<Revision> getSquashedRevisions(); List<Revision> getKeptRevisions();  }