Support populate

Add populate logic and tests.