### Question:
ReflectionHelper { @SuppressWarnings("unchecked") public static void setConfiguration(Component component, Config config) { try { Set<Field> fields = getAllFields(component.getClass(), withAnnotation(Configuration.class)); for (Field field : fields) { writeField(field, component, config, true); } } catch (Exception e) { throw new IllegalArgumentException("Unable to trident topology on component " + component.getClass(), e); } }  @SuppressWarnings("unchecked") static Map<String, Stream> getOutputStreams(Component component); @SuppressWarnings("unchecked") static Stream getOutputStream(Object obj, String name); @SuppressWarnings("unchecked") static List<String> getInputStreamNames(Class<? extends Component> componentClazz); static void setProperties(Object obj, List<PropertyConfiguration> properties); static void setInputStreams(Component component, Map<String, Stream> inputStreams); @SuppressWarnings("unchecked") static void setTopology(Component component, TridentTopology topology); @SuppressWarnings("unchecked") static void setConfiguration(Component component, Config config); @SuppressWarnings("unchecked") static void setFeaturesMapper(Component component, String streamName, NamedFeaturesMapper mapper); @SuppressWarnings("unchecked") static void setFeaturesMapper(Component component, String streamName, ListedFeaturesMapper mapper); @SuppressWarnings("unchecked") static void setStateFactory(Component component, String stateName, StateFactory stateFactory); @SuppressWarnings("unchecked") static void setInputStream(Component component, String name, Stream stream); @SuppressWarnings("unchecked") static NameMapper getNameMapper(Class<?> clazz, String stream); @SuppressWarnings("unchecked") static ListMapper getListMapper(Class<?> clazz, String stream); @SuppressWarnings({ "unchecked", "rawtypes" }) static Object getEnumValue(Class<?> clazz, String name);  }### Answer:
@Test public void should_set_configuration() { class TestComponent implements Component { @Configuration private Config config; @Override public void init() { } } TestComponent component = new TestComponent(); Config config = mock(Config.class); ReflectionHelper.setConfiguration(component, config); assertThat(component.config).isEqualTo(config); }