class Features {

    /**
     * Name of the Maven user property to enable or disable the build/consumer POM feature.
     */
    public static final String BUILDCONSUMER = "maven.buildconsumer";

    private Features() {}

    /**
     * Check if the build/consumer POM feature is active.
     */
    public static boolean buildConsumer(@Nullable Properties userProperties) {
        return doGet(userProperties, BUILDCONSUMER, true);
    }

    /**
     * Check if the build/consumer POM feature is active.
     */
    public static boolean buildConsumer(@Nullable Map<String, String> userProperties) {
        return doGet(userProperties, BUILDCONSUMER, true);
    }

    /**
     * Check if the build/consumer POM feature is active.
     */
    public static boolean buildConsumer(@Nullable Session session) {
        return buildConsumer(session != null ? session.getUserProperties() : null);
    }

    private static boolean doGet(Properties userProperties, String key, boolean def) {
        return doGet(userProperties != null ? userProperties.get(key) : null, def);
    }

    private static boolean doGet(Map<String, ?> userProperties, String key, boolean def) {
        return doGet(userProperties != null ? userProperties.get(key) : null, def);
    }

    private static boolean doGet(Object val, boolean def) {<FILL_FUNCTION_BODY>}
}

        if (val instanceof Boolean) {
            return (Boolean) val;
        } else if (val != null) {
            return Boolean.parseBoolean(val.toString());
        } else {
            return def;
        }
    
<no_super_class>