Added DocumentAdapter and its tests.