  Several recent experiments revealed a change of the sign of the first
harmonic in the current-phase relation of Josephson junctions (JJ) based on
novel superconductors, e.g., d-wave based or JJ with ferromagnetic barrier. In
this situation the role of the second harmonic becomes dominant and it
determines the scenario of a 0-pi transition. We discuss different mechanisms
of the second harmonic generation and its sign. If the second harmonic is
negative the 0-pi transition becomes continuous and the realization of the
so-called varphi junction is possible. We study the unusual properties of such
a novel JJ and analyze the possible experimental techniques for their
observation.
