Testament of Bolesław III Wrymouth

The last will and testament of the Piast duke Bolesław III Wrymouth of Poland, established rules for governance of the Polish kingdom by his four surviving sons after his death. By issuing it, Bolesław planned to guarantee that his heirs would not fight among themselves, and would preserve the unity of his lands under the Piast dynasty. However, soon after his death his sons fought each other, and Poland entered a period of fragmentation lasting about 200 years.

Provisions
Bolesław III issued the document around January 1115 (between the birth of his son Leszek and the rebellion of Skarbimir); it would be enacted upon his death in 1138. Bolesław divided the country into five principalities: The youngest son Casimir II the Just was not assigned any province; it is speculated that he was born after Bolesław's death, or that he was destined for a religious career.
 * the Seniorate Province (or Duchy of Kraków), composed of western Lesser Poland, the eastern parts of Greater Poland, western Kuyavia and Wieluń Land assigned to Bolesław's eldest son and future High Duke Władysław II, as well as the lands of Łęczyca Province (Łęczyca Land and Sieradz Land) which were held by Bolesław's widow Salomea of Berg for life and to revert to the Seniorate Province upon her death;
 * the Silesian Province (or Duchy of Silesia), comprising Silesia, also assigned to Władysław II;
 * the Masovian Province (or Duchy of Masovia), composed of Masovia proper and eastern Kuyavia, assigned to Bolesław's III second son Bolesław IV the Curly;
 * the Greater Poland Province (or Duchy of Greater Poland), composed of the remaining western parts of Greater Poland, assigned to the third son Mieszko III the Old,
 * the Sandomierz Province (or Duchy of Sandomierz), composed of eastern Lesser Polish territories centered around the city of Sandomierz, assigned to the fourth son Henry of Sandomierz.

The senioral principle established in the testament stated that at all times the eldest member of the dynasty (the Senior Prince, the Princeps or High Duke) was to have supreme power over the rest (Dux, the Dukes) and was also to control an indivisible "seniorate province" : a vast strip of land running north–south down the middle of Poland, with Kraków (the Kingdom of Poland's capital) its chief city. The Senior's prerogatives also included control over the Pomeranian vassals in Pomerelia, as a fief. The Senior was tasked with defense of borders, the right to have troops in provinces of other Dukes, carrying out foreign policy, supervision over the clergy (including the right to nominate bishops and archbishops), and minting of currency.

Aftermath
The senioral principle was soon broken, with Władysław II attempting to increase his power and his younger half-brothers opposing him. After initial success (taking over the Łęczyca Land after the death of Salomea), he was eventually defeated and expelled from Poland in 1146. With the help of Emperor Frederick I Barbarossa his sons managed to retain the Silesian Province in 1163, losing the Seniorate, which had passed to their uncle Bolesław IV. This led to a period of nearly 200 years of Poland's feudal fragmentation; the estrangement of the Silesian Piasts deepening after the death of Duke Henry II the Pious at the disastrous Battle of Legnica in 1241.

The Polish throne at Kraków remained contested between the descendants of Bolesław's III sons. Once Duke Władysław I the Elbow-high, a descendant of Casimir II the Just, was crowned King of Poland in 1320, he would reign on a smaller dominium, with Pomerelia lost to the State of the Teutonic Order and Silesia mostly vassalized by the Kingdom of Bohemia.