package com.sys1yagi.databindingsample.activities;


import com.sys1yagi.databindingsample.databinding.ActivityMvvmBinding;

import org.junit.Test;

import android.support.test.InstrumentationRegistry;
import android.view.LayoutInflater;

public class MVVMActivityTest {

    @Test
    public void test() {

        //OMG...
        //I faced the error below...
        //
        //java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        //
        //Because the source code for data binding is also generated in the test side, maybe.

        ActivityMvvmBinding binding = ActivityMvvmBinding.inflate(LayoutInflater.from(
                InstrumentationRegistry.getContext()
        ));
    }
}

@@ -232,16 +232,94 @@
 later;%0A%0A
+import static org.hamcrest.CoreMatchers.*;%0Aimport static org.junit.Assert.*;%0A%0A
 public c
@@ -660,16 +660,240 @@
 maybe.%0A%0A
+        //SOLVE: You should run on Android 5.0 or upper and run on Ui thread.%0A        InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() %7B%0A            @Override%0A            public void run() %7B%0A        
         
@@ -979,32 +979,40 @@
                 
+        
 InstrumentationR
@@ -1019,16 +1019,22 @@
 egistry.
+getTar
 getConte
@@ -1046,17 +1046,108 @@
         
-)
+        ));%0A                assertThat(binding, is(notNullValue()));%0A            %7D%0A        %7D
 );%0A    %7D

Fix test.