We propose and analyze theoretically an experimental setup for detecting the elusive Majorana particle in semiconductor-superconductor heterostructures. The experimental system consists of one-dimensional semiconductor wire with strong spin-orbit Rashba interaction embedded into a superconducting quantum interference device. We show that the energy spectra of the Andreev bound states at the junction are qualitatively different in topologically trivial (i.e., not containing any Majorana) and nontrivial phases having an even and odd number of crossings at zero energy, respectively. The measurement of the supercurrent through the junction allows one to discern topologically distinct phases and observe a topological phase transition by simply changing the in-plane magnetic field or the gate voltage. The observation of this phase transition will be a direct demonstration of the existence of Majorana particles.