Are you asking how to test if x is equal to 1/2?
What does the term: 1|2 mean?
The | operator is the bitwise OR. 1 ORed with 2 is 3. Try this:
System.out.println(3 == (1|2)); // this expression...