DependencyGraphTraceBuilderProperties { public DependencyGraphTraceBuilderProperties addRequirement(ValueRequirement requirement) { final Collection<ValueRequirement> currentRequirements = new ArrayList<>(getRequirements()); currentRequirements.add(requirement); return requirements(currentRequirements); } DependencyGraphTraceBuilderProperties(); private  DependencyGraphTraceBuilderProperties(DependencyGraphTraceBuilderProperties other); String getCalculationConfigurationName(); Instant getValuationTime(); VersionCorrection getResolutionTime(); ValueProperties getDefaultProperties(); Collection<ValueRequirement> getRequirements(); List<MarketDataSpecification> getMarketData(); DependencyGraphTraceBuilderProperties calculationConfigurationName(final String calculationConfigurationName); DependencyGraphTraceBuilderProperties resolutionTime(final VersionCorrection resolutionTime); DependencyGraphTraceBuilderProperties valuationTime(final Instant valuationTime); DependencyGraphTraceBuilderProperties defaultProperties(final ValueProperties defaultProperties); DependencyGraphTraceBuilderProperties addRequirement(ValueRequirement requirement); DependencyGraphTraceBuilderProperties requirements(final Collection<ValueRequirement> requirements); DependencyGraphTraceBuilderProperties marketData(final List<MarketDataSpecification> marketData); DependencyGraphTraceBuilderProperties addMarketData(MarketDataSpecification marketData); @Override String toString();  }
@Test public void addRequirement() { final ComputationTargetSpecification target = ComputationTargetSpecification.of(UniqueId.of("Scheme", "PrimitiveValue")); final ValueRequirement vr1 = new ValueRequirement("Value1", target); final ValueRequirement vr2 = new ValueRequirement("Value2", target); final DependencyGraphTraceBuilderProperties builder = createBuilder(); final Collection<ValueRequirement> r1 = builder.getRequirements(); final DependencyGraphTraceBuilderProperties prime = builder.addRequirement(vr1); final Collection<ValueRequirement> r2 = prime.getRequirements(); final DependencyGraphTraceBuilderProperties prime2 = prime.addRequirement(vr2); final Collection<ValueRequirement> r3 = prime2.getRequirements(); assertEquals(r1, builder.getRequirements()); assertEquals(r2, prime.getRequirements()); assertEquals(r1.size(), 0); assertEquals(r2.size(), 1); assertEquals(r3.size(), 2); }