@@ -0,0 +1,3023 @@
+/*%0A * This is free and unencumbered software released into the public domain.%0A *%0A * Please see https://github.com/binkley/binkley/blob/master/LICENSE.md.%0A */%0A%0Apackage hm.binkley.util;%0A%0Aimport org.ini4j.Ini;%0Aimport org.ini4j.Profile.Section;%0Aimport org.junit.runners.Parameterized;%0Aimport org.junit.runners.Parameterized.Parameters;%0A%0Aimport javax.annotation.Nonnull;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.function.Function;%0A%0Aimport static java.util.function.Function.identity;%0A%0A/**%0A * %7B@code ParameterizedHelper%7D assists in writing JUnit %7B@link Parameterized%7D tests.%0A *%0A * @author %3Ca href=%22mailto:binkley@alumni.rice.edu%22%3EB. K. Oxley (binkley)%3C/a%3E%0A */%0Apublic final class ParameterizedHelper %7B%0A    private ParameterizedHelper() %7B%7D%0A%0A    /**%0A     * Creates a list of parmeters for the %7B@link Parameters%7D static method.%0A     *%0A     * @param ini the INI file, never mising%0A     * @param keys the %7B@link Key keys%7D%0A     *%0A     * @return the parameters list, never missing%0A     */%0A    @Nonnull%0A    public static List%3CObject%5B%5D%3E parameters(@Nonnull final Ini ini, final Key... keys) %7B%0A        final List%3CObject%5B%5D%3E parameters = new ArrayList%3C%3E();%0A        for (final Section section : ini.values()) %7B%0A            final Object%5B%5D array = new Object%5B1 + keys.length%5D;%0A            array%5B0%5D = section.getName();%0A            for (int i = 0; i %3C keys.length; i++) %7B%0A                final Key key = keys%5Bi%5D;%0A                final String value = section.fetch(key.name);%0A                array%5B1 + i%5D = null == value ? null : key.get.apply(value);%0A            %7D%0A            parameters.add(array);%0A        %7D%0A        return parameters;%0A    %7D%0A%0A    /**%0A     * Tuple for defining INI section keys and how to map their values to test parameters.%0A     *%0A     * @see #parameters(Ini, Key...)%0A     */%0A    public static final class Key %7B%0A        public final String name;%0A        public final Function%3CString, ?%3E get;%0A%0A        /**%0A         * Creates a new %7B@code Key%7D for the given section key %3Cvar%3Ename%3C/var%3E and value%0A         * %3Cvar%3Eget%3C/var%3E function.%0A         *%0A         * @param name the section key name, never missing%0A         *%0A         * @return the new key, never missing%0A         *%0A         * @see #of(String)%0A         */%0A        @Nonnull%0A        public static Key of(@Nonnull final String name, @Nonnull final Function%3CString, ?%3E get) %7B%0A            return new Key(name, get);%0A        %7D%0A%0A        /**%0A         * Creates a new %7B@code Key%7D for the given section key %3Cvar%3Ename%3C/var%3E and an %7B@link%0A         * Function#identity() identity%7D value function.%0A         *%0A         * @param name the section key name, never missing%0A         *%0A         * @return the new key, never missing%0A         *%0A         * @see #of(String, Function)%0A         */%0A        @Nonnull%0A        public static Key of(@Nonnull final String name) %7B%0A            return of(name, identity());%0A        %7D%0A%0A        private Key(final String name, final Function%3CString, ?%3E get) %7B%0A            this.name = name;%0A            this.get = get;%0A        %7D%0A    %7D%0A%7D%0A

Add parameterized utils.