﻿{"id":688,"date":"2013-04-05T19:28:11","date_gmt":"2013-04-05T10:28:11","guid":{"rendered":"http:\/\/yucchi.jp\/blog\/?p=688"},"modified":"2013-04-24T19:55:16","modified_gmt":"2013-04-24T10:55:16","slug":"jdk8-lambda-%e3%81%9d%e3%81%ae%e4%bb%96%e3%81%84%e3%82%8d%e3%81%84%e3%82%8d-%e3%81%aa%e3%82%93%e3%81%a7%e3%82%82%e3%81%84%e3%81%84%e3%81%8b%e3%82%89%e5%8b%95%e3%81%8b%e3%81%97%e3%81%a6%e3%81%bf-3","status":"publish","type":"post","link":"http:\/\/yucchi.jp\/blog\/?p=688","title":{"rendered":"JDK8 Lambda \u305d\u306e\u4ed6\u3044\u308d\u3044\u308d \u306a\u3093\u3067\u3082\u3044\u3044\u304b\u3089\u52d5\u304b\u3057\u3066\u307f\u308b \u305d\u306e\uff14"},"content":{"rendered":"<p>\u4eca\u65e5\u3082\u3061\u3087\u3053\u3063\u3068\u3060\u3051 JDK8 \u306e\u65b0\u6a5f\u80fd\u3068\u622f\u308c\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u6628\u65e5\u306f\u30ed\u30ec\u30c3\u30af\u30b9\u306e\u58f2\u8cb7\u3092\u5168\u3066\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u65e5\u306f\u4e00\u756a\u82e5\u3044\u8cb7\u3044\u624b\u3092\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n<style type=\"text\/css\">\n<!--\ntable {color: #000000; background-color: #e9e8e2; font-family: \u3086\u305f\u307d\u3093\uff08\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09}\n-->\n<\/style>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td align=\"left\">mylambdaexamples\\MyLambdaExamples.java<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre start-line=\"46\">\r\n\/\/ \u4e00\u756a\u82e5\u3044\u8cb7\u3044\u624b\u3092\u8868\u793a\r\nSystem.out.println(\"\\n<-- \u4e00\u756a\u82e5\u3044\u8cb7\u3044\u624b\u3092\u8868\u793a -->\");\r\nOptional<List<Sale>> byYoungest;\r\nToIntFunction<Entry<Person, List<Sale>>> byAge;\r\nbyAge = e -> e.getKey().getAge();\r\nbyYoungest = sales.collect(groupingBy(Sale::getBuyer))\r\n          .entrySet()\r\n          .stream()\r\n          .sorted(comparing(byAge))\r\n          .map(Entry::getValue)\r\n          .findFirst();\r\nif (byYoungest.isPresent()) {\r\n    System.out.println((byYoungest.get().get(0).buyer.getFirstName()\r\n            + \" \" + byYoungest.get().get(0).buyer.getLastName()\r\n            + \", \" + byYoungest.get().get(0).buyer.getAge() + \"\u6b73\"));\r\n}\r\n<\/pre>\n<p>Optional , ToIntFunction , groupingBy() , findFirst() , isPresent() \u306a\u3069\u898b\u305f\u3053\u3068\u306e\u306a\u3044\u3082\u306e\u304c\u51fa\u73fe\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\"><strong>Optional <\/strong><\/font>\u306f JavaDoc \u3067\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8aac\u660e\u3055\u308c\u3066\u307e\u3059\u3002<\/p>\n<p><b><a href=\"about:blank*0\" target=\"_blank\">java.\u200butil<\/a><\/b> <\/p>\n<p><tt>public final class <b>Optional&lt;T&gt;<\/b> extends <a href=\"about:blank*1\" target=\"_blank\">Object<\/a><\/tt> <\/p>\n<p>A container object which may or may not contain a non-null value. If a value is present, <code>isPresent()<\/code> will return <code>true<\/code> and <code>get()<\/code> will return the value. <\/p>\n<p>Additional methods that depend on the presence or absence of a contained value are provided, such as <a href=\"about:blank*2\" target=\"_blank\">orElse()<\/a><code><\/code> (return a default value if value not present) and <a href=\"about:blank*3\" target=\"_blank\">ifPresent()<\/a><code><\/code> (execute a block of code if the value is present). <\/p>\n<p><b>\u65e5\u4ed8:<\/b> <\/p>\n<blockquote>\n<p>1.8 <\/p>\n<\/blockquote>\n<p>\u82f1\u8a9e\u306a\u306e\u3067\u826f\u304f\u89e3\u308a\u307e\u305b\u3093\u3002(&gt;_&lt;\uff61)<\/p>\n<p>isPresent() \u30e1\u30bd\u30c3\u30c9\u3068 get() \u30e1\u30bd\u30c3\u30c9\u3067\u64cd\u4f5c\u3055\u308c\u308b\u4fbf\u5229\u306a\u30d1\u30d6\u30ea\u30c3\u30af\u3067\u30d5\u30a1\u30a4\u30ca\u30eb\u306a\u30af\u30e9\u30b9\u306e\u3088\u3046\u3067\u3059\u306d\u3002\uff08\u306a\u3093\u3058\u3083\u3053\u308a\u3083\uff01\uff09<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\"><strong>ToIntFunction<\/strong><\/font> \u306f JavaDoc \u3067\u306f\u3069\u306e\u3088\u3046\u306b\u8aac\u660e\u3055\u308c\u3066\u308b\u306e\u304b\u307f\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><b><a href=\"about:blank*0\" target=\"_blank\">java.\u200butil.\u200bfunction<\/a><\/b> <\/p>\n<p><tt><a href=\"about:blank*1\" target=\"_blank\">@FunctionalInterface<\/a><\/tt><tt><br \/>public interface <b>ToIntFunction&lt;T&gt;<\/b><\/tt> <\/p>\n<p>Apply a function to the input argument, yielding an appropriate result. This is the <code>int<\/code>-bearing specialization for <a href=\"about:blank*2\" target=\"_blank\">Function<\/a><code><\/code>. <\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf:<\/b> <\/p>\n<blockquote><p><code>T<\/code> &#8211; the type of input objects to the function<\/p><\/blockquote>\n<p><b>\u65e5\u4ed8:<\/b> <\/p>\n<blockquote><p>1.8 <\/p><\/blockquote>\n<p><b>\u53c2\u7167:<\/b> <\/p>\n<blockquote><p><code><a href=\"about:blank*3\" target=\"_blank\">Function<\/a><\/code><\/p><\/blockquote>\n<p>\u5f53\u7136\u3053\u308c\u3082\u82f1\u8a9e\u3067\u3059\u306d\u3002<\/p>\n<p>@ FunctionalInterface \u3068\u306a\u3063\u3066\u307e\u3059\u3002<\/p>\n<p>ToIntFunction &lt;\uff34&gt;\u304c\u3001\u9069\u5207\u306a\u7d50\u679c\u3092\u3082\u305f\u3089\u3057\u3066\u3001\u95a2\u6570\u3092\u5909\u6570\u306b\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u95a2\u6570\u306e\u305f\u3081\u306b int \u3092\u751f\u3080\u5c02\u9580\u5316\u3067\u3059\u3002<\/p>\n<p>\u306a\u3093\u304b\u89e3\u3063\u305f\u3088\u3046\u306a\u89e3\u3089\u306a\u3044\u3088\u3046\u306a\u30fb\u30fb\u30fb<\/p>\n<p>\u6b8b\u308a\u306e\u898b\u6163\u308c\u306a\u3044\u3082\u306e\u3082\u8abf\u3079\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\"><strong>groupingBy()<\/strong><\/font><\/p>\n<p><b><a href=\"about:blank*0\" target=\"_blank\">java.\u200butil.\u200bstream.\u200bCollectors<\/a><\/b><\/p>\n<p><tt>public static &lt;T,K&gt; <a href=\"about:blank*1\" target=\"_blank\">Collector<\/a>&lt;T,<a href=\"about:blank*2\">Map<\/a>&lt;K,<a href=\"about:blank*3\">List<\/a>&lt;T&gt;&gt;&gt; <b>groupingBy<\/b>(<a href=\"about:blank*4\" target=\"_blank\">Function<\/a>&lt;? super T,? extends K&gt; classifier)<\/tt><\/p>\n<p>Returns a <code>Collector<\/code> that implements a &#8220;group by&#8221; operation on input elements of type <code>T<\/code>. <\/p>\n<p>Accepts a classification function from <code>T<\/code> to <code>K<\/code>. The collector produces a <code>Map<\/code> whose keys are the set of values resulting of applying the classification function to the input elements, and whose corresponding values are <code>List<\/code>s containing the input elements which map to the associated key under the classification function. <\/p>\n<p>No guarantees are made as to the type of the <code>Map<\/code> or the type of the <code>List<\/code> used for the map values. <\/p>\n<p><b>\u30d1\u30e9\u30e1\u30fc\u30bf:<\/b><\/p>\n<blockquote><p><code>classifier<\/code> &#8211; The classifier function mapping input elements to keys<\/p><\/blockquote>\n<p><b>\u578b\u30d1\u30e9\u30e1\u30fc\u30bf:<\/b><\/p>\n<blockquote><p><code>T<\/code> &#8211; The type of the input elements<br \/><code>K<\/code> &#8211; The type of the keys<\/p><\/blockquote>\n<p><b>\u623b\u308a\u5024:<\/b><\/p>\n<blockquote>\n<p>A <code>Collector<\/code> implementing the group-by operation <\/p>\n<\/blockquote>\n<p>public static &lt;T,K&gt; Collector&lt;T,Map&lt;K,List&lt;T&gt;&gt;&gt; groupingBy(Function&lt;? super T,? extends K&gt; classifier)\u304c<\/p>\n<p>\uff34\u306e\u30a4\u30f3\u30d7\u30c3\u30c8\u8981\u7d20\u306b\u95a2\u3057\u3066\u300c\u901a\u308a\u904e\u304e\u3066\u5206\u985e\u3059\u308b\u300d\u547d\u4ee4\u3092\u5b9f\u88c5\u3059\u308b\u30b3\u30ec\u30af\u30bf\u3092\u30ea\u30bf\u30fc\u30f3\u3059\u308b\u30ea\u30b9\u30c8\u304c\uff34\u304b\u3089\uff2b\u307e\u3067\u5206\u985e\u95a2\u6570\u3092\u53d7\u3051\u5165\u308c\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30ec\u30af\u30bf\u306f\u305d\u306e\u30ad\u30fc\u304c\u3001\u5206\u985e\u6a5f\u80fd\u3092\u30a4\u30f3\u30d7\u30c3\u30c8\u8981\u7d20\u306b\u9069\u7528\u3059\u308b\u3053\u3068\u306b\u3064\u3044\u3066\u3001\u7d50\u679c\u3068\u3057\u3066\u751f\u3058\u308b\u5024\u3067\u3042\u308b\u3001<\/p>\n<p>\u305d\u3057\u3066\u305d\u306e\u5bfe\u5fdc\u3059\u308b\u5024\u304c\u5206\u985e\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u306e\u4e0b\u3067\u63d0\u643a\u3055\u305b\u3089\u308c\u305f\u30ad\u30fc\u306b\u30de\u30c3\u30d7\u3059\u308b\u30a4\u30f3\u30d7\u30c3\u30c8\u8981\u7d20\u3092\u542b\u3093\u3067\u3044\u308b\u30ea\u30b9\u30c8\u3067\u3042\u308b\u30de\u30c3\u30d7\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u4fdd\u8a3c\u304c\u30de\u30c3\u30d7\u306e\u5024\u306e\u305f\u3081\u306b\u4f7f\u308f\u308c\u308b\u30bf\u30a4\u30d7\u306e\u30de\u30c3\u30d7\u3042\u308b\u3044\u306f\u30ea\u30b9\u30c8\u306e\u30bf\u30a4\u30d7\u306b\u3064\u3044\u3066\u4f5c\u3089\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\"><strong>findFirst()<\/strong><\/font> <\/p>\n<p><b><a href=\"about:blank*0\" target=\"_blank\">java.\u200butil.\u200bstream.\u200bStream<\/a><\/b><\/p>\n<p><tt>public <a href=\"about:blank*1\" target=\"_blank\">Optional<\/a>&lt;T&gt; <b>findFirst<\/b>()<\/tt><\/p>\n<p>Return an Optional describing the first element of this stream (in the encounter order), or an empty <code>Optional<\/code> if the stream is empty. <\/p>\n<p>This is a <a href=\"about:blankpackage-summary.html#StreamOps\" target=\"_blank\">short-circuiting terminal operation<\/a>. <\/p>\n<p><b>\u623b\u308a\u5024:<\/b><\/p>\n<blockquote>\n<p>\u3082\u3057\u30b9\u30c8\u30ea\u30fc\u30e0\u304c\u7a7a\u3067\u3042\u308b\u306a\u3089\u3001\u3053\u306e\u30b9\u30c8\u30ea\u30fc\u30e0\u306e\u7b2c\uff11\u30a8\u30ec\u30e1\u30f3\u30c8\uff08\u906d\u9047\u3059\u308b\u30aa\u30fc\u30c0\u30fc\uff09\u3001\u3042\u308b\u3044\u306f\u7a7a\u306e Optional \u3092\u8a18\u8ff0\u3057\u3066\u3044\u308b Optional \u3092\u8fd4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u308c\u306f\u7701\u3044\u3066\u3044\u308b\u30bf\u30fc\u30df\u30ca\u30eb\u64cd\u4f5c\u3067\u3059\u3002<\/p>\n<p>\u623b\u308a\u5024\uff1a<\/p>\n<p>Optional \u304c\u3001\u3082\u3057\u30b9\u30c8\u30ea\u30fc\u30e0\u304c\u7a7a\u306a\u3089\u3001\u3053\u306e\u30b9\u30c8\u30ea\u30fc\u30e0\u306e\u7b2c\uff11\u30a8\u30ec\u30e1\u30f3\u30c8\u3001\u3042\u308b\u3044\u306f\u7a7a\u306e Optional \u3092\u8a18\u8ff0\u3057\u307e\u3059<font size=\"3\">\u3002<\/font><\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p><font color=\"#ff0000\"><strong>isPresent()<\/strong><\/font><\/p>\n<p><a href=\"about:blank*0\"><b>java.\u200butil.\u200bOptional<\/b><\/a><\/p>\n<p><tt>public boolean <b>isPresent<\/b>()<\/tt><\/p>\n<p>Return <code>true<\/code> if there is a value present, otherwise <code>false<\/code>. <\/p>\n<p><b>\u623b\u308a\u5024:<\/b><\/p>\n<blockquote>\n<p><code>true<\/code> if there is a value present, otherwise <code>false<\/code><\/p>\n<\/blockquote>\n<p>\u3082\u3057\u5024\u304c\u5b58\u5728\u3059\u308b\u306a\u3089\u3070\u771f\u3092\u3001\u305d\u3046\u3067\u306a\u3044\u306a\u3089\u507d\u3092\u3092\u8fd4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a JavaDoc \u3092\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u79c1\u304c\u4f7f\u3063\u3066\u308b\u7ffb\u8a33\u652f\u63f4\u30bd\u30d5\u30c8\u3067\u306f\u6982\u306d\u3053\u306e\u3088\u3046\u306b\u7ffb\u8a33\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>Java7 \u304b\u3089\u65e5\u672c\u8a9e\u306e JavaDoc \u304c\u306a\u304f\u306a\u3063\u3066\u975e\u5e38\u306b\u6b8b\u5ff5\u3067\u3059\u3002<\/p>\n<p>Java8 \u3067\u65e5\u672c\u8a9e\u306e JavaDoc \u306e\u5fa9\u6d3b\u3092\u71b1\u304f\u6fc0\u3057\u304f\u3082\u3068\u3081\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u3053\u3068\u3092\u8e0f\u307e\u3048\u3066\u4eca\u56de\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3055\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>&lt;&#8211; \u4e00\u756a\u82e5\u3044\u8cb7\u3044\u624b\u3092\u8868\u793a &#8211;&gt;<br \/>\u6b66\u4e95 \u54b2, 19\u6b73<\/p>\n<p>\u304a\u304a\u3063\uff01\u4f55\u304c\u4f55\u3060\u304b\u826f\u304f\u89e3\u3089\u3093\u3051\u3069\u3061\u3083\u3093\u3068\u6b63\u89e3\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002\uff08\u30f2\u30d2<\/p>\n<p>\u8a73\u3057\u304f\u306f\u7406\u89e3\u3067\u304d\u306a\u3044\u3051\u3069\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30b3\u30fc\u30c9\u3068 JavaDoc \u3068\u3092\u7167\u3089\u3057\u5408\u305b\u3066\u307f\u308b\u3068\u4f55\u3068\u306a\u304f\u7406\u89e3\u3067\u304d\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u3067\u3082\u3001\u3053\u308c\u3063\u3066\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3068\u30bd\u30fc\u30c8\u3067\u3082\u3044\u3051\u305d\u3046\u306a\u6c17\u304c\u30fb\u30fb\u30fb<\/p>\n<p>\u307e\u3060\u307e\u3060\u65b0\u6a5f\u80fd\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u7406\u89e3\u3057\u306a\u3051\u308c\u3070\u30fb\u30fb\u30fb<\/p>\n<p>\u305d\u308c\u3067\u306f\u6b21\u56de\u3078\u7d9a\u304f\uff08\u307e\u3060\u7d9a\u304f\u306e\u304b\u30fb\u30fb\u30fb\uff09<\/p>\n<div id=\"scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f9d757cd-e5c0-4985-891c-02c7af50b0be\" class=\"wlWriterEditableSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">Hatena \u30bf\u30b0: <a href=\"http:\/\/b.hatena.ne.jp\/t\/Java\" rel=\"tag\">Java<\/a><\/div>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_hatena\"><a href='\/\/b.hatena.ne.jp\/add?mode=confirm&url=http%3A%2F%2Fyucchi.jp%2Fblog%2F%3Fp%3D688&title=JDK8%20Lambda%20%E3%81%9D%E3%81%AE%E4%BB%96%E3%81%84%E3%82%8D%E3%81%84%E3%82%8D%20%E3%81%AA%E3%82%93%E3%81%A7%E3%82%82%E3%81%84%E3%81%84%E3%81%8B%E3%82%89%E5%8B%95%E3%81%8B%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B%20%E3%81%9D%E3%81%AE%EF%BC%94' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='http:\/\/yucchi.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/hatena.gif' alt='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' width='16' height='12' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_facebook\"><a href='http:\/\/www.facebook.com\/share.php?u=http%3A%2F%2Fyucchi.jp%2Fblog%2F%3Fp%3D688&t=JDK8%20Lambda%20%E3%81%9D%E3%81%AE%E4%BB%96%E3%81%84%E3%82%8D%E3%81%84%E3%82%8D%20%E3%81%AA%E3%82%93%E3%81%A7%E3%82%82%E3%81%84%E3%81%84%E3%81%8B%E3%82%89%E5%8B%95%E3%81%8B%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B%20%E3%81%9D%E3%81%AE%EF%BC%94' title='Facebook \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='http:\/\/yucchi.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/facebook.png' alt='Facebook \u306b\u30b7\u30a7\u30a2' title='Facebook \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"http:\/\/yucchi.jp\/blog\/?p=688\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"http:\/\/yucchi.jp\/blog\/?p=688\" data-text=\"JDK8 Lambda \u305d\u306e\u4ed6\u3044\u308d\u3044\u308d \u306a\u3093\u3067\u3082\u3044\u3044\u304b\u3089\u52d5\u304b\u3057\u3066\u307f\u308b \u305d\u306e\uff14\" data-lang=\"ja\">Tweet<\/a><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u65e5\u3082\u3061\u3087\u3053\u3063\u3068\u3060\u3051 JDK8 \u306e\u65b0\u6a5f\u80fd\u3068\u622f\u308c\u3066\u307f\u307e\u3059\u3002 \u6628\u65e5\u306f\u30ed\u30ec\u30c3\u30af\u30b9\u306e\u58f2\u8cb7\u3092\u5168\u3066\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3057\u305f\u3002 \u4eca\u65e5\u306f\u4e00\u756a\u82e5\u3044\u8cb7\u3044\u624b\u3092\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3059\u3002 mylambdaexamples\\MyLambdaExamples.java \/\/ \u4e00\u756a\u82e5\u3044\u8cb7\u3044\u624b\u3092\u8868\u793a System.out.println(&#8220;\\n&#8221;); Optional byYoungest; ToIntFunction byAge; byAge = e -> e.getKey().getAge(); byYoungest = sales.collect(groupingBy(Sale::getBuyer)) .entrySet() .st\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17],"class_list":["post-688","post","type-post","status-publish","format-standard","hentry","category-java","tag-java"],"_links":{"self":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=688"}],"version-history":[{"count":2,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/688\/revisions"}],"predecessor-version":[{"id":790,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/688\/revisions\/790"}],"wp:attachment":[{"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=688"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yucchi.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}