class Capybara::Result

def lazy_select_elements(&block)

def lazy_select_elements(&block)
  # JRuby has an issue with lazy enumerators which
  # causes a concurrency issue with network requests here
  # https://github.com/jruby/jruby/issues/4212
  if RUBY_PLATFORM == 'java'
    @elements.select(&block).to_enum # non-lazy evaluation
  else
    @elements.lazy.select(&block)
  end
end