BitcoindeOrderBook { public BitcoindeOrderBook( @JsonProperty("asks") BigDecimal[][] asks, @JsonProperty("bids") BigDecimal[][] bids) { this.asks = asks; this.bids = bids; Arrays.sort( this.asks, new Comparator<BigDecimal[]>() { @Override public int compare(final BigDecimal[] entry1, final BigDecimal[] entry2) { final BigDecimal price1 = entry1[0]; final BigDecimal price2 = entry2[0]; return price1.compareTo(price2); } }); Arrays.sort( this.bids, new Comparator<BigDecimal[]>() { @Override public int compare(final BigDecimal[] entry1, final BigDecimal[] entry2) { final BigDecimal price1 = entry1[0]; final BigDecimal price2 = entry2[0]; return -1 * price1.compareTo( price2); } }); } BitcoindeOrderBook(
      @JsonProperty("asks") BigDecimal[][] asks, @JsonProperty("bids") BigDecimal[][] bids); BigDecimal[][] getAsks(); BigDecimal[][] getBids(); Date getTimeStamp(); @Override String toString();  }
@Test public void testBitcoindeOrderBook() throws JsonParseException, JsonMappingException, IOException { InputStream is = BitcoindeOrderBookTest.class.getResourceAsStream( "/org/knowm/xchange/bitcoinde/dto/orderbook.json"); ObjectMapper mapper = new ObjectMapper(); BitcoindeOrderbookWrapper bitcoindeOrderBook = mapper.readValue(is, BitcoindeOrderbookWrapper.class); assertEquals( bitcoindeOrderBook.getBitcoindeOrders().getAsks()[0].getPrice(), new BigDecimal("2461.61")); assertEquals( bitcoindeOrderBook.getBitcoindeOrders().getAsks()[0].getAmount(), new BigDecimal("0.0406218")); assertEquals( bitcoindeOrderBook.getBitcoindeOrders().getBids()[0].getPrice(), new BigDecimal("1200")); assertEquals( bitcoindeOrderBook.getBitcoindeOrders().getBids()[0].getAmount(), new BigDecimal("8.333")); }