UserViewModel extends BaseObservable { public void setUser(User user) { this.user = user; notifyChange(); } UserViewModel(User user); String getUsername(); String getImageUrl(); @BindingAdapter({ "bind:imageUrl" }) static void loadImage(ImageView view, String imageUrl); void setUser(User user);  }
@Test public void testSetUser() throws Exception { mockUser.setLogin("NewName"); userViewModel.setUser(mockUser); Assert.assertEquals("NewName", userViewModel.getUsername()); }