<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>irof</author_name>
  <author_url>https://blog.hatena.ne.jp/irof/</author_url>
  <blog_title>日々常々</blog_title>
  <blog_url>https://irof.hateblo.jp/</blog_url>
  <categories>
    <anon>Java</anon>
  </categories>
  <description>Javaの Stream の話です。 Stream は複数のものを扱いますが、結果が1つ（もしくは0 or 1個）だけ欲しい場合がよくあります。 こういう時に使用できるのが findFirst と findAny です。 jshell&gt; Stream.of(&quot;hoge&quot;, &quot;fuga&quot;, &quot;piyo&quot;).findFirst() $1 ==&gt; Optional[hoge] jshell&gt; Stream.of(&quot;hoge&quot;, &quot;fuga&quot;, &quot;piyo&quot;).findAny() $2 ==&gt; Optional[hoge] 結果は同じで、先頭の &quot;hoge&quot; が返っています。findなんで Optio…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Firof.hateblo.jp%2Fentry%2F2026%2F03%2F02%2F233604&quot; title=&quot;「いちばんめ」が大事でないならfindFirstよりfindAnyを使う - 日々常々&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/i/irof/20260302/20260302233914.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-03-02 23:36:04</published>
  <title>「いちばんめ」が大事でないならfindFirstよりfindAnyを使う</title>
  <type>rich</type>
  <url>https://irof.hateblo.jp/entry/2026/03/02/233604</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
