ConfigInstanceUtil { public static Object getField(ConfigBuilder builder, String fieldName) { try { Field f = builder.getClass().getDeclaredField(fieldName); f.setAccessible(true); return f.get(builder); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { throw new RuntimeException(e); } }  static void setValues(BUILDER destination, BUILDER source); static T getNewInstance(Class<T> type, String configId, ConfigPayload payload); static Object getField(ConfigBuilder builder, String fieldName);  }
@Test public void test_require_private_getter() { FunctionTestConfig.Builder builder = createVariableAccessBuilder(); assertEquals(ConfigInstanceUtil.getField(builder, "int_val"), 5); FunctionTestConfig conf = new FunctionTestConfig(builder); assertEquals(conf.int_val(), 5); }