You took the problem on the wrong side. There your loop will continue where you want to stop.
You should simply do the following and reverse the condition
do {
} while (!(x == -1 && y == -1 || x == 5 || y == 10));
Demo
public static void main (String[] args) {
System.out.println(conditionTesting(0, -1)); // true
System.out.println(conditionTesting(-1, -1)); // false
System.out.println(conditionTesting(5, -1)); // false
System.out.println(conditionTesting(-1, 10)); // false
System.out.println(conditionTesting(6, 9)); // true
}
public static boolean conditionTesting(int x, int y) {
return !(x == -1 && y == -1 || x == 5 || y == 10);
}
DeMorgan
If you want to go and represent it using DeMorgan's Law, you can do it using the following steps
¬((P ∧ Q) ∨ R ∨ S)
≡¬(P ∧ Q) ∧ ¬R ∧ ¬S
≡(¬P ∨ ¬Q) ∧ ¬R ∧ ¬S
So your final translation would be
(x != -1 || y != -1) && x != 5 && y != 10
Ideone Demo