### Question:
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; default: throw new IllegalArgumentException("Unknown Price Level Update type. Cannot process."); } } IEXOrderBook(final String symbol); void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage); @Override String getSymbol(); @Override List<PriceLevel> getBidLevels(); @Override List<PriceLevel> getAskLevels(); @Override PriceLevel getBestAskOffer(); @Override PriceLevel getBestBidOffer(); @Override String toString();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionForUnknownMessageType() { final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage = anIEXPriceLevelUpdateMessage() .withIEXMessageType(IEXMessageType.OPERATIONAL_HALT_STATUS) .build(); final IEXOrderBook orderBook = new IEXOrderBook(TEST_SYMBOL); orderBook.priceLevelUpdate(iexPriceLevelUpdateMessage); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowAnExceptionForUnknownEventFlag() { final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage = anIEXPriceLevelUpdateMessage() .withIEXEventFlag(null) .build(); final IEXOrderBook orderBook = new IEXOrderBook(TEST_SYMBOL); orderBook.priceLevelUpdate(iexPriceLevelUpdateMessage); }