FragmentBuilder { public Fragment newFragment(FragmentManager fragmentManager, String tag) { Fragment fragment = fragmentManager.findFragmentByTag(tag); if (!TextUtils.isEmpty(tag) && fragment != null) { return fragment; } try { fragment = clazz.newInstance(); if (args != null) { fragment.setArguments(args); } return fragment; } catch (Exception e) { e.printStackTrace(); } return null; } FragmentBuilder(Class<? extends Fragment> clazz, String tag); @SuppressWarnings("unchecked")  FragmentBuilder(String className, String tag); FragmentBuilder setArguments(@Nullable Bundle args); void addToView(FragmentManager fragmentManager, @IdRes int idRes); Fragment getFragment(FragmentManager fragmentManager); Fragment newFragment(FragmentManager fragmentManager, String tag);  }
@Test public void newFragment() { }