class CustomNameExtractor {

    public static Optional<String> getName( Supplier<String> nameSupplier, Supplier<String> valueSupplier )
    {
        String name = nameSupplier.get().trim();
        if ( !name.isEmpty() )
        {
            return Optional.of( name );
        }
        String value = valueSupplier.get().trim();
        if ( !value.isEmpty() )
        {
            return Optional.of( value );
        }
        return Optional.empty();
    }

    private  CustomNameExtractor();

}