A man died and left his insurance money to his brother and two sons.

But the brother was actually the dead man's nephew, one son was the dead man's brother and the other son was not even related.On top of that, the dead man worked for a New York company under a different name and used funds the company said he embezzled to pay insurance premiums, prompting the company to claim the inheritance.

Who gets the money?

On Wednesday, U.S. District Judge H. Lee Sarokin issued an opinion clearing away the brambles of the complicated court case that at times sounds like a sphinx-like riddle.

The dispute centers on the insurance polices of Robert Danna of Nutley, who died at age 47 two years ago. He designated the proceeds of two insurance policies, totaling $47,299.32, to his sons Barry and Dominick, brother Phillip and his own estate.

A third policy, worth $100,266.50, was designated for Dominick.

But, said Judge Sarokin, Barry Danna is Robert Danna's brother; Phillip Danna is Robert Danna's nephew; and Dominick Danna is not related to Robert Danna. Dominick is actually Dominick Ricco, a young man whom Robert Danna took under his wing for the last years of his life.

Mr. Ricco's attorney, Frank Arleo, said Robert Danna treated his 29-year- old client like the son he never had. He said Mr. Ricco was working as a locksmith in Hawaii.

The other parties dispute that Mr. Danna called Mr. Ricco a son, said Judge Sarokin, but not that the older man involved the younger one in many of his business transactions, and that the two developed a close personal relationship.

But Barry Danna, who lived with his brother and was named administrator of his estate, said the third policy should go to him because Mr. Ricco was not related to Robert Danna.

Dominick's real last name and his real relationship to Robert Danna do not matter, said Judge Sarokin. What matters is Robert Danna's intent.

Therefore, Judge Sarokin ruled, Mr. Ricco is entitled to the benefits Robert Danna designated for him, as all other parties are entitled to benefits he designated for them.

But the case does not stop there.

Webster Soda Fountain Manufacturing Corp. hired a man named Robert Sosa in May 1984 as its bookkeeper. Webster Soda charged that Mr. Sosa embezzled $389,490.54 for two years until his death in May 1986, Judge Sarokin said.

Only after Mr. Sosa's death did Webster Soda learn that 'Robert Sosa' was actually Robert Danna, Judge Sarokin said.

The Bronx, N.Y., company charged the insurance premiums were partly paid with its funds, so put a claim on the benefits.

As Dominick Ricco has failed to dispute Webster Soda's allegations of embezzlement, the court treats them as established, wrote the judge.

Mr. Ricco argued that since the embezzled funds and Mr. Danna's personal

funds were mingled and untraceable, Webster Soda has no claim.

Judge Sarokin ruled that the company can recover money in proportion to the amount of its own embezzled funds that Mr. Danna used to pay for the policies.

The parties have another long row to hoe. Judge Sarokin told them to work out an agreement on apportionment of the funds. If they can't agree he told them to submit to a magistrate's decision.