@Test public void changesOnOriginalEventListDoNotInterfereWithCut() { final List<TradeEvent> origList = new ArrayList<>(); origList.add(SOME_PENDING_ORDER_OPENED); final BasicCompletedTrade cut = new BasicCompletedTrade(BUY, LIMIT, origList); origList.add(SOME_ORDER_CLOSED); assertThat(cut.getEvents()).containsExactly(SOME_PENDING_ORDER_OPENED); }
public List<TradeEvent> getEvents() { return events; }
BasicCompletedTrade { public List<TradeEvent> getEvents() { return events; } }
BasicCompletedTrade { public List<TradeEvent> getEvents() { return events; } BasicCompletedTrade(final OrderType type, final ExecutionCondition executionCondition,
            final List<TradeEvent> events); }
BasicCompletedTrade { public List<TradeEvent> getEvents() { return events; } BasicCompletedTrade(final OrderType type, final ExecutionCondition executionCondition,
            final List<TradeEvent> events); OrderType getType(); ExecutionCondition getExecutionCondition(); List<TradeEvent> getEvents(); Optional<Price> getRelativeProfit(); Optional<Ratio> getRateOfReturn(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString(); }
BasicCompletedTrade { public List<TradeEvent> getEvents() { return events; } BasicCompletedTrade(final OrderType type, final ExecutionCondition executionCondition,
            final List<TradeEvent> events); OrderType getType(); ExecutionCondition getExecutionCondition(); List<TradeEvent> getEvents(); Optional<Price> getRelativeProfit(); Optional<Ratio> getRateOfReturn(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }