@Test public void testOverride() { final MockSPI mock = mock(MockSPI.class); SpiFactory.override(MockSPI.class, mock); assertThat(SpiFactory.getProvider(MockSPI.class)).isSameAs(mock); }
@SuppressWarnings("unchecked") public static <T> T override(final Class<T> clazz, final T object) { return (T) overrides.put(clazz, object); }
SpiFactory { @SuppressWarnings("unchecked") public static <T> T override(final Class<T> clazz, final T object) { return (T) overrides.put(clazz, object); } }
SpiFactory { @SuppressWarnings("unchecked") public static <T> T override(final Class<T> clazz, final T object) { return (T) overrides.put(clazz, object); }  }
SpiFactory { @SuppressWarnings("unchecked") public static <T> T override(final Class<T> clazz, final T object) { return (T) overrides.put(clazz, object); }  @SuppressWarnings("unchecked") static T override(final Class<T> clazz, final T object); static void removeOverride(final Class<?> clazz); @SuppressWarnings("unchecked") static T getProvider(final Class<T> clazz); }
SpiFactory { @SuppressWarnings("unchecked") public static <T> T override(final Class<T> clazz, final T object) { return (T) overrides.put(clazz, object); }  @SuppressWarnings("unchecked") static T override(final Class<T> clazz, final T object); static void removeOverride(final Class<?> clazz); @SuppressWarnings("unchecked") static T getProvider(final Class<T> clazz);  }