Although the current Japanese legal system is based on the Anglo-American model, there was a time prior to its conquest in WWII where they used a system modeled after Germany.
Background
Prussian dominance can probably be traced back to amity and commerce treaty signed in 1861 between Prussia and Japan, structured with a unilateral most-favoured-nation clause benefiting the former.
This influence grew over the early part of the Meiji era (1868-1912) with attempts to modernize Japanese military and industry.
Constitutional Reform
Following the Satsuma Rebellion, where traditionalists attempted to oppose modernization efforts, some different forms of representational government from around the world were examined.
Tom Cruise’s “The Last Samurai” is loosely based on the Satsuma Rebellion
A British-style model was advocated early on by Okuma Shigenobu of the Constitutional Progressive Party.
Instead, a study was launched in 1882 to examine legal systems abroad, led by Ito Hirobumi.
Andrew E. Barshay writes in State and Intellectual in Imperial Japan,
Ito acutely recognized the need for a state apparatus capable of realizing a strong constitutional order that simultaneously placed the source of its legitimacy out of mortal reach.
French and Spanish models were rejected as too despotic, and the American and British were considered too liberal and disempowering of the monarch.
Hirobumi decided to spend his time in Prussia (now Germany), and decided their model was superior to the others.
Japan even sent academics abroad to study at Prussian universities, and briefly based Kyoto Imperial University on the Prussian educational system.
Objections and Demise
Not all Japanese were ecstatic of these specific initiatives.
Uchimura Kanzo wrote in 1898,
One of the many foolish and deplorable mistakes which the Satsuma-Choshu Government have committed is their having selected Germany as the example to be followed in their administrative policy. Because its military organization is wellnigh perfect, and its imperialism a gift of its army, therefore they thought that it ought to be taken as the pattern of our own Empire. . . . Germany is certainly a great nation, but it is not the greatest, neither is it the most advanced. It is often said that Art, Science, and Philosophy have their homes in Germany, that Thought has its primal spring there. But it is not in Germany that Thought is realized to its fullest extent. Thought may originate in Germany, but it is actualized somewhere else. The Lutheran Reformation bore its greatest fruit in England and America.
German expansion into the far east led to cooling of relations between the two countries.
Military alliances in WW II strengthen relations again, but the defeat of both resulted in restructuring along the lines of the occupying Allied forces.
German influence over contemporary Japan remains limited, though the Crown Princess of Japan today does speak German.
Resources
Shinya Murase. (1976). The Most-Favored-Nation Treatment in Japan’s Treaty Practice During the Period 1854-1905. The American Journal of International Law 70(2):273-297.
Andrew E. Barshay. (1991). State and Intellectual in Imperial Japan. The Public Man in Crisis. University of California Press.