Implemented Heap in Java