Indonesia's historical inhabitants were animists, Hindus, and Buddhists. Through assimilation related to trade, royal conversion, and conquest, however, Islam had supplanted Hinduism and Buddhism as the dominant religion of Java and Sumatra by the end of the 16th century. During this process, "cultural influences from the Hindu-Buddhist era were mostly tolerated or incorporated into Islamic rituals." Islam didn't obliterate the preexisting culture; rather, it incorporated and embedded the local customs and non-Islamic elements among rules and arts, and reframed them as the Islamic traditions.