package com.android21buttons.fragmenttestrule;

import android.support.v4.app.Fragment;

import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;

public class FragmentTestRuleTest {
    @Before
    public void setUp() throws Exception {

    }

    @Test
    public void createFragment() throws Exception {
        FragmentTestRule<?, Fragment> testRule = FragmentTestRule.create(Fragment.class);

        assertThat(testRule.createFragment(), is(notNullValue()));
    }

    @Test
    public void getFragmentCreate() throws Exception {
        FragmentTestRule<?, Fragment> testRule = FragmentTestRule.create(Fragment.class);

        final Fragment fragment = testRule.createFragment();
        assertThat(testRule.getFragment(), is(fragment));
    }

    @Test
    public void getFragmentNoCreate() throws Exception {
        FragmentTestRule<?, Fragment> testRule = FragmentTestRule.create(Fragment.class);

        assertThat(testRule.getFragment(), is(nullValue()));
    }
}

@@ -80,16 +80,64 @@
 ragment;
+%0Aimport android.support.v4.app.FragmentActivity;
 %0A%0Aimport
@@ -583,32 +583,36 @@
 ment%3E testRule =
+ new
  FragmentTestRul
@@ -608,32 +608,51 @@
 mentTestRule
-.create(
+%3C%3E(FragmentActivity.class, 
 Fragment.cla
@@ -836,32 +836,36 @@
 ment%3E testRule =
+ new
  FragmentTestRul
@@ -861,32 +861,51 @@
 mentTestRule
-.create(
+%3C%3E(FragmentActivity.class, 
 Fragment.cla
@@ -1151,16 +1151,20 @@
 stRule =
+ new
  Fragmen
@@ -1176,16 +1176,35 @@
 Rule
-.create(
+%3C%3E(FragmentActivity.class, 
 Frag

Fix tests to compile