@Test public void create_withInvalidClassName_shouldThrowException() throws Exception { try { CustomEventNativeFactory.create("com.mopub.nativeads.inVaLiDClassssssName1231232131"); fail("CustomEventNativeFactory did not throw exception on create"); } catch (Exception e) { } }
public static CustomEventNative create(@Nullable final String className) throws Exception { if (className != null) { final Class<? extends CustomEventNative> nativeClass = Class.forName(className) .asSubclass(CustomEventNative.class); return instance.internalCreate(nativeClass); } else { return new MoPubCustomEventNative(); } }
CustomEventNativeFactory { public static CustomEventNative create(@Nullable final String className) throws Exception { if (className != null) { final Class<? extends CustomEventNative> nativeClass = Class.forName(className) .asSubclass(CustomEventNative.class); return instance.internalCreate(nativeClass); } else { return new MoPubCustomEventNative(); } } }
CustomEventNativeFactory { public static CustomEventNative create(@Nullable final String className) throws Exception { if (className != null) { final Class<? extends CustomEventNative> nativeClass = Class.forName(className) .asSubclass(CustomEventNative.class); return instance.internalCreate(nativeClass); } else { return new MoPubCustomEventNative(); } }  }
CustomEventNativeFactory { public static CustomEventNative create(@Nullable final String className) throws Exception { if (className != null) { final Class<? extends CustomEventNative> nativeClass = Class.forName(className) .asSubclass(CustomEventNative.class); return instance.internalCreate(nativeClass); } else { return new MoPubCustomEventNative(); } }  static CustomEventNative create(@Nullable final String className); @Deprecated // for testing static void setInstance(
            @NonNull final CustomEventNativeFactory customEventNativeFactory); }
CustomEventNativeFactory { public static CustomEventNative create(@Nullable final String className) throws Exception { if (className != null) { final Class<? extends CustomEventNative> nativeClass = Class.forName(className) .asSubclass(CustomEventNative.class); return instance.internalCreate(nativeClass); } else { return new MoPubCustomEventNative(); } }  static CustomEventNative create(@Nullable final String className); @Deprecated // for testing static void setInstance(
            @NonNull final CustomEventNativeFactory customEventNativeFactory);  }