@@ -0,0 +1,1763 @@
+/*%0A * Copyright 2012 Jakub Dominik Kozlowski %3Cmail@jakub-kozlowski.com%3E%0A * Distributed under the The MIT License.%0A * (See accompanying file LICENSE)%0A */%0A%0Apackage icebook.book;%0A%0Aimport icebook.book.OrderBook.Entry;%0Aimport icebook.order.Side;%0Aimport org.testng.annotations.Test;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.is;%0A%0A/**%0A * Tests %7B@link DefaultOrderBook%7D.%0A *%0A * @author Jakub D Kozlowski%0A * @since 1.0%0A */%0Apublic class DefaultOrderBookTest %7B%0A%0A    @Test(expectedExceptions = NullPointerException.class)%0A    public void testInsertNullEntry() %7B%0A        new DefaultOrderBook().insert(null);%0A    %7D%0A%0A    @Test%0A    public void testConstructor() %7B%0A        final OrderBook book = new DefaultOrderBook();%0A        assertThat(book.toSortedSet(Side.SELL).isEmpty(), is(true));%0A        assertThat(book.toSortedSet(Side.BUY).isEmpty(), is(true));%0A    %7D%0A%0A    @Test%0A    public void testInsertSellEntries() %7B%0A        final OrderBook book = new DefaultOrderBook();%0A        final Entry entry1 = OrderBooks.newEntry(1, 123, Side.SELL, 123, 123);%0A        final Entry entry2 = OrderBooks.newEntry(2, 124, Side.SELL, 124, 123);%0A        book.insert(entry1);%0A        book.insert(entry2);%0A        assertThat(book.toSortedSet(Side.SELL).toArray(new Entry%5B%5D%7B%7D), is(new Entry%5B%5D %7Bentry1, entry2%7D));%0A    %7D%0A%0A    @Test%0A    public void testInsertBuyEntries() %7B%0A        final OrderBook book = new DefaultOrderBook();%0A        final Entry entry1 = OrderBooks.newEntry(1, 123, Side.BUY, 123, 123);%0A        final Entry entry2 = OrderBooks.newEntry(2, 124, Side.BUY, 124, 123);%0A        book.insert(entry1);%0A        book.insert(entry2);%0A        assertThat(book.toSortedSet(Side.BUY).toArray(new Entry%5B%5D%7B%7D), is(new Entry%5B%5D %7Bentry2, entry1%7D));%0A    %7D%0A%7D%0A

Add tests for insert.