UniBook extends ValueFreezer<V> { public final UniBookResult make(final MarketDoBookEntry entry) { make: if (isValidEntryEnums(entry)) { final UniBookResult result; switch (entry.act()) { case MODIFY: result = makeModify(entry); break; case REMOVE: result = makeRemove(entry); break; default: break make; } switch (result) { case TOP: case NORMAL: saveLastSide(entry.side()); break; default: break; } return result; } return ERROR; } UniBook(final Instrument instrument, final Book.Type type, 
			final SizeValue size, final PriceValue step); final void clear(); final UniBookResult make(final MarketDoBookEntry entry); @Override String toString(); @Override V freeze(); @Override boolean isFrozen();  }
@Test() public void testNullEntryAddDelete() { final SizeValue size = newSize(10); final PriceValue priceStep = newPrice(25, -2); final UniBook book = new UniBook(Instrument.NULL, Book.Type.COMBINED, size, priceStep); UniBookResult result; result = book.make(null); assertEquals(result, ERROR); result = book.make(null); assertEquals(result, ERROR); }
@Test() public void testWrongEnums() { final SizeValue size = newSize(10); final PriceValue step = newPrice(25, -2); final UniBook book = new UniBook(Instrument.NULL, Book.Type.COMBINED, size, step); DefBookEntry entry; UniBookResult result; entry = new DefBookEntry( NOOP, Book.Side.NULL, Book.Type.NONE, 0, newPrice(1000, -2), NULL_SIZE); result = book.make(entry); assertEquals(result, ERROR); entry = new DefBookEntry( MODIFY, Book.Side.NULL, Book.Type.NONE, 0, newPrice(1000, -2), NULL_SIZE); result = book.make(entry); assertEquals(result, ERROR); entry = new DefBookEntry( MODIFY, Book.Side.BID, Book.Type.NONE, 0, newPrice(1000, -2), NULL_SIZE); result = book.make(entry); assertEquals(result, ERROR); entry = new DefBookEntry( MODIFY, Book.Side.BID, Book.Type.DEFAULT, 0, newPrice(1000, -2), NULL_SIZE); result = book.make(entry); assertEquals(result, TOP); }