2021222324252627282930
} return false; } public Object convertValue(String value, Type type) { Trader trader = persister.retrieveTrader(value); if (trader == null) { throw new ParameterConvertionFailed("Trader not found for name " + value, null); } return trader; }
225226227228229230231
} return mockTradePersister().retrieveTrader(name); } static TraderPersister mockTradePersister() { return new TraderPersister(new Trader("Mauro", asList(new Stock("STK1", 10.d)))); }
891011121314
public Stock newStock(String symbol, double threshold) { return new Stock(symbol, threshold); } public Trader newTrader(String name, String rank) { return new Trader(name, rank); }