### Question:
DiffTree extends AbstractGeoGigOp<AutoCloseableIterator<DiffEntry>> implements Supplier<AutoCloseableIterator<DiffEntry>> { public void call(PreOrderDiffWalk.Consumer consumer) { checkArgument(oldRefSpec != null || oldTreeId != null || oldTree != null, "old version not specified"); checkArgument(newRefSpec != null || oldTreeId != null || newTree != null, "new version not specified"); final ObjectStore leftSource; final ObjectStore rightSource; leftSource = this.leftSource == null ? objectDatabase() : this.leftSource; rightSource = this.rightSource == null ? objectDatabase() : this.rightSource; final RevTree oldTree = resolveTree(oldRefSpec, this.oldTreeId, this.oldTree, leftSource); final RevTree newTree = resolveTree(newRefSpec, this.newTreeId, this.newTree, rightSource); final PreOrderDiffWalk visitor = new PreOrderDiffWalk(oldTree, newTree, leftSource, rightSource, preserveIterationOrder); visitor.setDefaultMetadataId(this.metadataId); visitor.walk(consumer); } DiffTree(); DiffTree recordStats(); Optional<Stats> getStats(); DiffTree setOldVersion(String oldRefSpec); DiffTree setNewVersion(String newRefSpec); DiffTree setOldTree(ObjectId oldTreeId); DiffTree setNewTree(ObjectId newTreeId); DiffTree setOldTree(RevTree oldTree); DiffTree setNewTree(RevTree newTree); DiffTree setPreserveIterationOrder(boolean preserveIterationOrder); DiffTree setPathFilter(@Nullable String path); DiffTree setPathFilter(@Nullable Collection<String> pathFitlers); DiffTree setBoundsFilter(@Nullable Envelope bounds); DiffTree setCustomFilter(@Nullable Predicate<Bounded> customFilter); DiffTree setChangeTypeFilter(@Nullable ChangeType changeType); DiffTree setConsumerWrapper(PreOrderDiffWalk.ForwardingConsumer wrapper); @Override AutoCloseableIterator<DiffEntry> get(); void call(PreOrderDiffWalk.Consumer consumer); DiffTree setReportTrees(boolean reportTrees); DiffTree setReportFeatures(boolean reportFeatures); DiffTree setRecursive(boolean recursive); DiffTree setMaxDiffs(@Nullable Long limit); DiffTree setDefaultMetadataId(ObjectId metadataId); DiffTree setLeftSource(ObjectStore leftSource); DiffTree setNodeOrdering(NodeOrdering diffNodeOrdering); DiffTree setRightSource(ObjectStore rightSource);  }### Answer:
@Test public void testNoOldVersionSet() { Exception e = assertThrows(IllegalArgumentException.class, () -> diffTree.call()); assertThat(e.getMessage(), containsString("old version")); }