# Unionby Isai Damier, Android Engineer @ Google

```/***************************************************************************
* Author: Isai Damier
* Title: Union
* Project: geekviewpoint
* Package: algorithms
*
* Statement:
*   Given two sets of bits, x and y, find their union.
*
* Sample Input:  0110101; 0101100
* Sample Output: 0111101
*
* Technical Details:
*   The union of two sets is the superset comprising all the elements that
*   appear in both sets. For example if s1 = [a,b,f,h,k] and
*   s2 = [b,c,d,f,h,position] then the union of s1 and s2 is
*   s1 U s2 = [a,b,c,d,f,h,position,k]. For two sets of bits the union is
*   simply the bitwise OR of the two sets. For example if x = 0110101 and
*   y=0101100 then the union of x and y is x U y = 0111101.
*
**************************************************************************/
public int union(int x, int y) {
return x | y;
}```
```import org.junit.Test;
import static org.junit.Assert.*;

public class BitwiseTest {

/**
* Test of union method, of class Bitwise.
*/
@Test
public void testUnion() {
System.out.println(""union"");
int x = Integer.parseInt(""0101100"", 2);
int y = Integer.parseInt(""0110101"", 2);
int u = Integer.parseInt(""0111101"", 2);
Bitwise bits = new Bitwise();
assertEquals(u, bits.union(x, y));
}
}```