Implement BitAnd in Java