static int MAX_TESTS = 5;
int test = 0;
boolean result = true;
int something = 6;
while(test < MAX_TESTS && result)
result = (something > 7);
EDIT: Basically, the while loop takes a boolean condition. This can be the result of a single boolean method or evaluation, or multiple boolean results and'ed or or'ed together (or any other boolean arithmetic).
by darkagn: Further explanation of the while loop condition