@Test
public void testMap() {

    LiveData<String> source = new MutableLiveData<>();
    LiveData<Integer> mapped = Transformations.map(source, new Function<String, Integer>() {
        @Override
        public Integer apply(String input) {
            return input.length();
        }
    });
    Observer<Integer> observer = mock(Observer.class);
    mapped.observe(mOwner, observer);
    source.setValue("four");
    verify(observer).onChanged(4);
}