@Test public void testRunOnUiThread() {

	// Arrange:
	final FragmentActivity activity = Robolectric.buildActivity(TestCompatActivity.class).create().start().resume().get();
	final FragmentManager fragmentManager = activity.getSupportFragmentManager();
	final BaseFragment fragment = new TestFragment();
	fragmentManager.beginTransaction().add(fragment, null).commit();
	fragmentManager.executePendingTransactions();
	Executors.newSingleThreadExecutor().execute(new Runnable() {
		@Override public void run() {
			// Act + Assert:
			assertThat(fragment.runOnUiThread(new Runnable() {
				@Override public void run() {
					fragmentManager.beginTransaction().remove(fragment).commit();
					fragmentManager.executePendingTransactions();
				}
			}), is(true));
		}
	});
}