Imam al-Shafi'i (may Allah have mercy on him) said: Most people said the same, except Tawus and a few others with him, who said: The bequest is established for those relatives who are not heirs, so whoever makes a bequest to a non-relative, it is not valid. We found that the Messenger of Allah (peace and blessings be upon him) gave a ruling concerning six slaves who belonged to a man who had no wealth besides them. He freed them at the time of his death. the Prophet (peace and blessings be upon him) divided them into three parts: "He freed two slaves and kept four in slavery."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوصايا / 12548