@Test
    public void WhenStaticRandomSelect_ExpectRefMaxHostsInResult()
            throws UnknownHostException {
        ArrayList<Host> list = new ArrayList<Host>(1);
        Host host0 = new PGridHost("127.0.0.1", 3333);
        Host host1 = new PGridHost("127.0.0.1", 1111);
        list.add(host0);
        list.add(host1);

        int refMax = 100;
        Collection<Host> result = RoutingTable.randomSelect(refMax, list);
        Assert.assertTrue(result.size() <= refMax);
        Assert.assertTrue(result.size() == 2);
        Assert.assertTrue(result.contains(host0) && result.contains(host1));

        refMax = 1;
        result = RoutingTable.randomSelect(refMax, list);
        Assert.assertTrue(result.size() <= refMax);
        Assert.assertTrue(result.size() == 1);
        Assert.assertFalse(result.contains(host0) && result.contains(host1));
        Assert.assertTrue(result.contains(host0) || result.contains(host1));
    }