public void testRandomConnectionFilter() {
int source = rand.nextInt(100000);
int target = rand.nextInt(100000);
Connection conn = new SimpleConnection(source, target, true);
ConnectionFilter connFilter = new RandomConnectionFilter();
boolean rejected = false;
boolean accepted = false;
while(!rejected) {
rejected = !connFilter.accept(conn);
}
while(!accepted) {
accepted = connFilter.accept(conn);
}
assertEquals(true, rejected);
assertEquals(true, accepted);
}