class Settings {

    public static BiFunction<Long,Function<String,String>,Long> powerOf2()
    {
        return new BiFunction<Long,Function<String,String>,Long>()
        {
            @Override
            public Long apply( Long value, Function<String,String> settings )
            {
                if ( value != null && !Numbers.isPowerOfTwo( value ) )
                {
                    throw new IllegalArgumentException( "only power of 2 values allowed" );
                }
                return value;
            }

            @Override
            public String toString()
            {
                return "is power of 2";
            }
        };
    }

    private  Settings();

}