class BitsoTradeDemo {

  public static void main(String[] args) throws IOException {

    Exchange bitso = BitsoDemoUtils.createExchange();
    TradeService tradeService = bitso.getTradeService();

    generic(tradeService);
    raw((BitsoTradeServiceRaw) tradeService);
  }

  private static void generic(TradeService tradeService) throws IOException {<FILL_FUNCTION_BODY>}

  private static void printOpenOrders(TradeService tradeService) throws IOException {

    OpenOrders openOrders = tradeService.getOpenOrders();
    System.out.println("Open Orders: " + openOrders.toString());
  }

  private static void raw(BitsoTradeServiceRaw tradeService) throws IOException {

    printRawOpenOrders(tradeService);

    // place a limit buy order
    BitsoOrder order =
        tradeService.sellBitsoOrder(new BigDecimal("0.01"), new BigDecimal("5000.00"));
    System.out.println("BitsoOrder return value: " + order);

    printRawOpenOrders(tradeService);

    // Cancel the added order
    boolean cancelResult = tradeService.cancelBitsoOrder(order.getId());
    System.out.println("Canceling returned " + cancelResult);

    printRawOpenOrders(tradeService);
  }

  private static void printRawOpenOrders(BitsoTradeServiceRaw tradeService) throws IOException {

    BitsoOrder[] openOrders = tradeService.getBitsoOpenOrders();
    System.out.println("Open Orders: " + openOrders.length);
    for (BitsoOrder order : openOrders) {
      System.out.println(order.toString());
    }
  }
}


    printOpenOrders(tradeService);

    // place a limit buy order
    LimitOrder limitOrder =
        new LimitOrder(
            (OrderType.ASK),
            new BigDecimal("0.01"),
            new CurrencyPair(Currency.BTC, Currency.MXN),
            "",
            null,
            new BigDecimal("5000.00"));
    String limitOrderReturnValue = tradeService.placeLimitOrder(limitOrder);
    System.out.println("Limit Order return value: " + limitOrderReturnValue);

    printOpenOrders(tradeService);

    // Cancel the added order
    boolean cancelResult = tradeService.cancelOrder(limitOrderReturnValue);
    System.out.println("Canceling returned " + cancelResult);

    printOpenOrders(tradeService);
  
<no_super_class>