He feared persecution in Nigeria for being gay. The Hungarian psychologist used questionable tests to evaluate the Nigerian man and ultimately concluded that the man was not homosexual.
F claimed that the tests prejudiced his fundamental rights, but Hungary's Institute of Forensic Experts and Investigators defended the methods used during the procedure for examining the asylum application.
"The performance of such a test amounts to a disproportionate interference in the private life of the asylum seeker", the Luxembourg-based court argued, rejecting the principle of the act.
"Such interference is particularly serious because it is meant to give an insight into the most intimate aspects of the asylum seeker's life", the court said in a statement.
In 2014, the ECJ ruled on a similar case in the Netherlands that three gay men who had been jailed in countries in Africa and the Middle East should be granted asylum.
"Authorities must be equipped to determine the reliability of a person's claim", added the court.
Global business confidence on a high but risks abound, CEOs warn
Climate change and environmental damage is reported among the top five threats for businesses in Asia Pacific and Western Europe. More broadly, the survey found that 57% of global business leaders believe economic growth will improve over the course of 2018.
The psychologist decided the Nigerian man was not in fact gay and his asylum plea was rejected; his appeal prompted the European Union court ruling.
The ECJ stated in the new ruling that "certain forms of expert reports may prove useful", but said that these reports infringed on a person's privacy.
F said the tests had violated his fundamental rights and they had not provided any assessment of "the plausibility of his sexual orientation", the ECJ said.
In 2010 to determine whether they were gay.
The Hungarian court handling F's case quoted him as saying that he had not undergone any physical examination and had not been required to view pornographic photographs or videos.
Hungarian interior minister Sandor Pinter (C) and Hungarian Defence Minister Csaba Hende (L) answer a journalist's question during a press conference next to the first portion of a temporary fence the Hungarian military is erecting on its border to Serbia in an effort to keep out refugees on July 16, 2015 at Morahalom near Szeged, Hungary.