final String expected =
"transactions%5B0%5D%5Btimestamp%5D=2010-04-27%2015%3A42%3A17%200200&transactions%5B0%5D%5Busage%5D%5Bhits%5D=1&transactions%5B0%5D%5Bapp_id%5D=foo&" +
"transactions%5B1%5D%5Btimestamp%5D=2010-04-27%2015%3A55%3A12%200200&transactions%5B1%5D%5Busage%5D%5Bhits%5D=1&transactions%5B1%5D%5Bapp_id%5D=bar&" +
"provider_key=1234abcd";
ParameterMap app1 = new ParameterMap();
app1.add("app_id", "foo");
app1.add("timestamp", "2010-04-27 15:42:17 0200");
ParameterMap usage1 = new ParameterMap();
usage1.add("hits", "1");
app1.add("usage", usage1);
ParameterMap app2 = new ParameterMap();
app2.add("app_id", "bar");
app2.add("timestamp", "2010-04-27 15:55:12 0200");
ParameterMap usage2 = new ParameterMap();
usage2.add("hits", "1");
app2.add("usage", usage2);
ParameterMap[] transactions = new ParameterMap[2];
transactions[0] = app1;
transactions[1] = app2;
ParameterMap params = new ParameterMap();
params.add("provider_key", "1234abcd");
params.add("transactions", transactions);
assertEquals(expected, encoder.encode(params));
}