Q:

Convert two booleans to an int

Probably this is extremely easy. 
If I have two booleans, a and b, how can I get the equivalent "binary" number?
false and false = 0 
false and true  = 1 
true  and false = 2 
true  and true  = 3 

A:

(left ? 2 : 0) + (right ? 1 : 0);

Not sure if java handles booleans like C, but if it does:
2*left+right;

A:

Since you have marked this as language-agnostic, I'd post how to do this in Scala. :-)
scala> implicit def boolToAddable(a: Boolean) = new {
     |   def +(b: Boolean): Int = (a, b) match {
     |     case (false, false) => 0
     |     case (false, true)  => 1
     |     case (true,  false) => 2
     |     case (true,  true)  => 3
     |   }
     | }
boolToAddable: (a: Boolean)java.lang.Object{def +(b: Boolean): Int}

scala> false + false
res0: Int = 0

scala> false + true
res1: Int = 1

scala> true + false
res2: Int = 2

scala> true + true
res3: Int = 3

Alternatively you could use the trick suggested by @David above:
scala> implicit def boolToAddable(a: Boolean) = new {
     |   def +(b: Boolean) = (if(a) 2 else 0) + (if(b) 1 else 0)
     | }
boolToAddable: (a: Boolean)java.lang.Object{def +(b: Boolean): Int}

