source: class CopyTwitterStrategyTest {
  
  	private static final double ZERO;
  	private String userIdfoo;
  	private String userIdbar;
  
  	@Test
  	public void harvestAndTradeTest() throws InterruptedException {
  
target: 		CopyTwitterStrategy<String> copyTwitterStrategy = new CopyTwitterStrategy<String>();
  		FXTweetHandler<String> tweetHandlerFoo = createTweetHandlerFoo(copyTwitterStrategy);
  		BlockingQueue<TradingDecision<String>> orderQueue = new LinkedBlockingQueue<TradingDecision<String>>();
  		copyTwitterStrategy.orderQueue = orderQueue;
  		copyTwitterStrategy.init();
  		Tweet tweet1 = mock(Tweet.class);
  		Collection<Tweet> footweets = Lists.newArrayList(tweet1);
  		NewFXTradeTweet<String> newTrade = mock(NewFXTradeTweet.class);
  		when(tweetHandlerFoo.findNewTweets()).thenReturn(footweets);
  		when(tweetHandlerFoo.handleTweet(tweet1)).thenReturn(newTrade);
  		when(newTrade.getAction()).thenReturn(TradingSignal.SHORT);
  		TradeableInstrument<String> euraud = new TradeableInstrument<String>("EUR_AUD");
  		when(newTrade.getInstrument()).thenReturn(euraud);
  		double[] profits = { 11.32, 17.7, 8.2, 19.0, 44.5, -11.0, 10, 25.5 };
  		Collection<CloseFXTradeTweet<String>> closedTrades = createClosedTrades(profits);
  		footweets = Lists.newArrayList();
  		for (CloseFXTradeTweet<String> closeTradeTweet : closedTrades) {
  			Tweet tweet = mock(Tweet.class);
  			when(tweetHandlerFoo.handleTweet(tweet)).thenReturn(closeTradeTweet);
  			footweets.add(tweet);
  		}
  		when(tweetHandlerFoo.findHistoricPnlTweetsForInstrument(euraud)).thenReturn(footweets);
  		copyTwitterStrategy.harvestAndTrade();
  		TradingDecision<String> decision = orderQueue.take();
  		assertEquals(TradingSignal.SHORT, decision.getSignal());
  		assertEquals(euraud, decision.getInstrument());
  	}
  
  }