As German Chancellor Angela Merkel prepared to discuss Europe’s future on a visit to Poland, she won an unlikely endorsement from her sometimes prickly eastern neighbor. Jaroslaw Kaczynski, the governing Law & Justice party leader, in effect backed Merkel’s bid for a fourth term, saying he prefers her to Social Democrat candidate Martin Schulz, who said last year that Poland was turning into a democracy resembling Russia. “Frau Merkel would be best for us,” Kaczynski was cited as saying in an interview with Frankfurter Allgemeine Zeitung newspaper to be published on Tuesday. Relations cooled after a change of government in Warsaw 16 months ago led to a clash with the European Union over its control of the courts and media. Merkel was personally rebuffed last year when the Polish government refused to implement an EU agreement to accept refugees, despite her repeated pleas for a European solution to the biggest migration crisis since World War II. Fast forward to 2017 and the wartime foes are being drawn together. U.S. President Donald Trump’s overtures to Russia’s Vladimir Putin—in stark contrast to Merkel’s role in imposing European sanctions on Russia—and the shared German and Polish interest in keeping the EU together mean the two leaders now have more in common than dividing them. Europe’s Paymaster Germany also needs to keep Poland onside with the EU facing its biggest ever test of unity following Britain’s decision to leave. For its part, Poland is the largest single recipient of EU money and the government is relying on the funding to keep the economy growing as private investment stalls. Germany is also by far the country’s biggest trading partner. “Merkel is now making a much bigger effort to keep Europe together and that’s what this visit is about, despite all the differences,’’ said Judy Dempsey, a senior fellow at Carnegie Europe in Berlin and author of “The Merkel Phenomenon.” “She hasn’t done a bad job so far and I think Warsaw would like her to continue doing this.’’ In a signal of the importance of Tuesday’s trip, Merkel will meet Poland’s president and prime minister before sitting down with Kaczynski, the real power in the country. Merkel wants to hear if Poland will support the four main points of a declaration on the EU’s future to be adopted in Rome next month. There’s a broad agreement between Poland and Germany on the single market, European security and policies to boost employment for youth, though some differences remain over immigration, according to a source close to the German government. Brexit is also being discussed. Pragmatism ultimately will trump politics, according to diplomats. Economically, Poland’s trade with Germany amounts to more than $100 billion a year. That’s about 28 percent of total imports and exports and more than the next five countries combined.  “Despite all the rhetoric, business is business,’’ Krzysztof Kalicki, chief executive officer of Deutsche Bank AG’s Polish business for the past 16 years and a former deputy finance minister, said in an interview at his office. “We need to reduce uncertainty around the politics, regulation, the legal framework and taxation. It’s important to also talk about these issues, which matter to economic cooperation.’’ Eastern Bloc  Merkel and her Polish hosts share a common background in the former eastern bloc. As a young woman, she traveled from her home in what was then East Germany to Poland when the Solidarity movement was agitating against the communist government, and has since holidayed in the Polish Baltic Sea region near Gdansk.  She met Kaczynski when he was prime minister a decade ago. This time around, the Law & Justice government has come under unprecedented EU scrutiny for undermining the rule of law and its politicians have long played on some anti-German sentiment in Poland to a local audience. On the eve of her visit in Poland, Kaczynski blamed her for German media critical coverage of the Polish government. Poland wants a good relationship with Germany but “Germany must decide,” he told the Do Rzeczy weekly. “We can’t accept politics where on the international level things are fine, while in the media there’s constant, nonsense attack on Poland.” The German chancellor also has been a supporter of Donald Tusk, the former Polish prime minister who now is EU president. Kaczynski has said a second term for Tusk, who was part of the opposition Civic Platform, is a “bad idea.’’ Merkel will also meet Grzegorz Schetyna, the current leader of Civic Platform. As Merkel seeks common ground in a bid to save EU unity, she likely will address Poland’s domestic issues, including the Constitutional Tribunal that Law & Justice revamped and packed with its appointees. The government, which put state-held broadcasters under direct government control, is working on a draft to place limits on media ownership, potentially hurting German and U.S. investors whose Polish news outlets are often critical of the government. “It’s better to talk with each other rather than about each other,” German deputy government spokesperson Ulrike Demmer said on Friday in Berlin. “Generally, Merkel is somebody who likes to address all critical issues with her partners. In this fashion, she will also address those topics that are critical in Poland right now.”