{"id":295560,"date":"2019-12-17T16:19:38","date_gmt":"2019-12-17T16:19:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=295560"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=295560","title":{"rendered":"Pipes &amp; Filters. \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Spring"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/479464\/\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Pipes &amp; Filters.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0437\u0436\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0448\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DI (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Spring).<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0435.<br \/>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0438 \u043f\u043e\u0434\u0432\u0435\u0434\u0451\u043c \u0438\u0442\u043e\u0433.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"zadacha\">\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0443\u0447\u0430 \u043e\u0434\u0435\u0436\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u0441\u0443\u0448\u043a\u0438 \u0438 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0448\u043a\u0430\u0444. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 (\u043e\u0434\u0435\u0436\u0434\u0430) \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0438\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u0432\u0438\u0434\u0435 (\u0432 \u0448\u043a\u0430\u0444\u0443, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u043e\u0434\u0435\u0436\u0434\u0443).<\/p>\n<p>  <\/p>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043a \u043d\u0430\u043c. \u042d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0442.\u0434.<br \/>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u0434\u0435\u0436\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u043e\u0433\u043b\u0430\u0436\u0435\u043d\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043c\u044f\u0442\u0430. <\/p>\n<p>  <\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c <code>Modifier<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">    public class Modifier {      public List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modify(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430){         \u0433\u043b\u0430\u0434\u0438\u0442\u044c(\u043e\u0434\u0435\u0436\u0434\u0430);         return \u043e\u0434\u0435\u0436\u0434\u0430;     }      private void \u0433\u043b\u0430\u0434\u0438\u0442\u044c(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430) {         \u043e\u0434\u0435\u0436\u0434\u0430.stream()         .filter(\u041e\u0434\u0435\u0436\u0434\u0430::\u043c\u044f\u0442\u0430\u044f)         .forEach(o -&gt; {             \/\/\u0433\u043b\u0430\u0436\u0443         });     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u044f\u0441\u043d\u043e. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u044f \u043c\u044f\u0442\u0430\u044f \u043e\u0434\u0435\u0436\u0434\u0430 \u0431\u044b\u043b\u0430 \u043f\u043e\u0433\u043b\u0430\u0436\u0435\u043d\u0430.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043a\u043b\u0430\u0441\u0441\u0430 <code>Modifier<\/code>:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0435 \u043a\u043b\u0430\u0441\u0442\u044c \u0432 \u0448\u043a\u0430\u0444 \u0433\u0440\u044f\u0437\u043d\u043e\u0435 \u0431\u0435\u043b\u044c\u0451<\/li>\n<li>\u0420\u0443\u0431\u0430\u0448\u043a\u0438, \u043f\u0438\u0434\u0436\u0430\u043a\u0438 \u0438 \u0431\u0440\u044e\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0438\u0441\u0435\u0442\u044c \u043d\u0430 \u043f\u043b\u0435\u0447\u0438\u043a\u0430\u0445<\/li>\n<li>\u0414\u044b\u0440\u044f\u0432\u044b\u0435 \u043d\u043e\u0441\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0448\u0438\u0442\u044c<\/li>\n<li>&#8230;<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0442\u043e\u0436\u0435 \u0432\u0430\u0436\u043d\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u043e\u0434\u0435\u0436\u0434\u0443 \u043d\u0430 \u043f\u043b\u0435\u0447\u0438\u043a\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u0433\u043b\u0430\u0434\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 <code>Modifier<\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public class Modifier {      private static final Predicate&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u0414\u041e\u041b\u0416\u041d\u041e_\u0412\u0418\u0421\u0415\u0422\u042c_\u041d\u0410_\u041f\u041b\u0415\u0427\u0418\u041a\u0410\u0425 =             ((Predicate&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt;)\u0420\u0443\u0431\u0430\u0448\u043a\u0430.class::isInstance)                 .or(\u0411\u0440\u044e\u043a\u0438.class::isInstance)                 .or(\u041f\u0438\u0434\u0436\u0430\u043a.class::isInstance)             ;      public List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modify(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430){         \u0437\u0430\u0448\u0438\u0442\u044c\u041d\u043e\u0441\u043a\u0438(\u043e\u0434\u0435\u0436\u0434\u0430);         \u0433\u043b\u0430\u0434\u0438\u0442\u044c(\u043e\u0434\u0435\u0436\u0434\u0430);         \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442\u044c\u0413\u0440\u044f\u0437\u043d\u043e\u0435(\u043e\u0434\u0435\u0436\u0434\u0430);         \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c\u041d\u0430\u041f\u043b\u0435\u0447\u0438\u043a\u0438(\u043e\u0434\u0435\u0436\u0434\u0430);         \/\/\u0435\u0449\u0451 \u0425 \u0448\u0430\u0433\u043e\u0432         return \u043e\u0434\u0435\u0436\u0434\u0430;     }      private void \u0437\u0430\u0448\u0438\u0442\u044c\u041d\u043e\u0441\u043a\u0438(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430) {         \u043e\u0434\u0435\u0436\u0434\u0430.stream()         .filter(\u041d\u043e\u0441\u043e\u043a.class::isInstance)         .map(\u041d\u043e\u0441\u043e\u043a.class::cast)         .filter(\u041d\u043e\u0441\u043e\u043a::\u043f\u043e\u0440\u0432\u0430\u043d)         .forEach(o -&gt; {             \/\/\u0437\u0430\u0448\u0438\u0432\u0430\u044e         });     }      private void \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c\u041d\u0430\u041f\u043b\u0435\u0447\u0438\u043a\u0438(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430) {         \u043e\u0434\u0435\u0436\u0434\u0430.stream()         .filter(\u0414\u041e\u041b\u0416\u041d\u041e_\u0412\u0418\u0421\u0415\u0422\u042c_\u041d\u0410_\u041f\u041b\u0415\u0427\u0418\u041a\u0410\u0425)         .forEach(o -&gt; {             \/\/\u0432\u0435\u0448\u0430\u044e \u043d\u0430 \u043f\u043b\u0435\u0447\u0438\u043a\u0438         });     }      private void \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442\u044c\u0413\u0440\u044f\u0437\u043d\u043e\u0435(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430) {         \u043e\u0434\u0435\u0436\u0434\u0430.removeIf(\u041e\u0434\u0435\u0436\u0434\u0430::\u0433\u0440\u044f\u0437\u043d\u0430\u044f);     }      private void \u0433\u043b\u0430\u0434\u0438\u0442\u044c(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430) {         \u043e\u0434\u0435\u0436\u0434\u0430.stream()         .filter(\u041e\u0434\u0435\u0436\u0434\u0430::\u043c\u044f\u0442\u0430\u044f)         .forEach(o -&gt; {             \/\/\u0433\u043b\u0430\u0436\u0443         });     }      \/\/\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u0442\u0430\u043b\u0438 \u0438 \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0418 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043a\u043e\u0434, \u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b\u0430 \u043f\u043e\u0440\u0430 \u0434\u043b\u044f Refactoring.<\/p>\n<p>  <\/p>\n<h2 id=\"refactoring\">Refactoring<\/h2>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430, \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u044b\u0439 \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u0432\u0441\u0435\u0439 \u043e\u0434\u0435\u0436\u0434\u044b. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u043c\u044b \u0432\u0441\u0451 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u043e\u0434\u0438\u043d \u0446\u0438\u043a\u043b, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0446\u0438\u043a\u043b\u0430: <\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public class Modifier {      private static final Predicate&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u0414\u041e\u041b\u0416\u041d\u041e_\u0412\u0418\u0421\u0415\u0422\u042c_\u041d\u0410_\u041f\u041b\u0415\u0427\u0418\u041a\u0410\u0425 =             ((Predicate&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt;)\u0420\u0443\u0431\u0430\u0448\u043a\u0430.class::isInstance)                 .or(\u0411\u0440\u044e\u043a\u0438.class::isInstance)                 .or(\u041f\u0438\u0434\u0436\u0430\u043a.class::isInstance)             ;      public List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modify(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430){         List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; result = new ArrayList&lt;&gt;();         for(var o : \u043e\u0434\u0435\u0436\u0434\u0430){             if(o.\u0433\u0440\u044f\u0437\u043d\u0430\u044f()){                 continue;             }             result.add(o);             \u0437\u0430\u0448\u0438\u0442\u044c\u041d\u043e\u0441\u043a\u0438(o);             \u0433\u043b\u0430\u0434\u0438\u0442\u044c(o);             \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c\u041d\u0430\u041f\u043b\u0435\u0447\u0438\u043a\u0438(o);             \/\/\u0435\u0449\u0451 \u0425 \u0448\u0430\u0433\u043e\u0432         }          return result;     }      private void \u0437\u0430\u0448\u0438\u0442\u044c\u041d\u043e\u0441\u043a\u0438(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e\u0434\u0435\u0436\u0434\u0430) {         if(\u043e\u0434\u0435\u0436\u0434\u0430 instanceof  \u041d\u043e\u0441\u043e\u043a){             \/\/\u0437\u0430\u0448\u0438\u0432\u0430\u044e (\u041d\u043e\u0441\u043e\u043a) \u043e\u0434\u0435\u0436\u0434\u0430         }     }      private void \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c\u041d\u0430\u041f\u043b\u0435\u0447\u0438\u043a\u0438(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e\u0434\u0435\u0436\u0434\u0430) {        if(\u0414\u041e\u041b\u0416\u041d\u041e_\u0412\u0418\u0421\u0415\u0422\u042c_\u041d\u0410_\u041f\u041b\u0415\u0427\u0418\u041a\u0410\u0425.test(\u043e\u0434\u0435\u0436\u0434\u0430)){             \/\/\u0432\u0435\u0448\u0430\u044e \u043d\u0430 \u043f\u043b\u0435\u0447\u0438\u043a\u0438         }     }      private void \u0433\u043b\u0430\u0434\u0438\u0442\u044c(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e\u0434\u0435\u0436\u0434\u0430) {         if(\u043e\u0434\u0435\u0436\u0434\u0430.\u043c\u044f\u0442\u0430\u044f()){             \/\/\u0433\u043b\u0430\u0436\u0443         }     }      \/\/\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0434\u0435\u0436\u0434\u044b \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u043a\u043e\u0434 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0434\u043b\u044f \u0442\u0435\u043b\u0430 \u0446\u0438\u043a\u043b\u0430. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u0435\u043b\u043e \u0446\u0438\u043a\u043b\u0430.<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>modify(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e)<\/code>: <\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modify(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430){     List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; result = new ArrayList&lt;&gt;();     for(var o : \u043e\u0434\u0435\u0436\u0434\u0430){         if(o.\u0433\u0440\u044f\u0437\u043d\u0430\u044f()){             continue;         }         result.add(o);         modify(o);     }      return result; }  private void modify(\u041e\u0434\u0435\u0436\u0434\u0430 o) {     \u0437\u0430\u0448\u0438\u0442\u044c\u041d\u043e\u0441\u043a\u0438(o);     \u0433\u043b\u0430\u0434\u0438\u0442\u044c(o);     \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c\u041d\u0430\u041f\u043b\u0435\u0447\u0438\u043a\u0438(o);     \/\/\u0435\u0449\u0451 \u0425 \u0448\u0430\u0433\u043e\u0432 }<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0436\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0432 \u043e\u0434\u0438\u043d <code>Consumer<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">private Consumer&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modification =         ((Consumer&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt;) this::\u0437\u0430\u0448\u0438\u0442\u044c\u041d\u043e\u0441\u043a\u0438)                 .andThen(this::\u0433\u043b\u0430\u0434\u0438\u0442\u044c)                 .andThen(this::\u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c\u041d\u0430\u041f\u043b\u0435\u0447\u0438\u043a\u0438); \/\/\u0435\u0449\u0451 \u0425 \u0448\u0430\u0433\u043e\u0432  public List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modify(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430){     return \u043e\u0434\u0435\u0436\u0434\u0430.stream()             .filter(o -&gt; !o.\u0433\u0440\u044f\u0437\u043d\u0430\u044f())             .peek(modification)             .collect(Collectors.toList()); }<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u041e\u0442\u0441\u0443\u043f\u043b\u0435\u043d\u0438\u0435: peek<br \/>  \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b peek \u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438. Sonar \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0441\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442, \u0442.\u043a. \u0432 Javadoc \u043a peek \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043b\u044f debug&#8217;a. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 map: .map(o -&gt; {modification.accept(o);return o;}), \u0442\u043e IDEA \u0441\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c peek<\/p><\/blockquote>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<blockquote><p>\u041e\u0442\u0441\u0443\u043f\u043b\u0435\u043d\u0438\u0435: Consumer<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0441 Consumer (\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441 Function) \u0434\u0430\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430.<\/p><\/blockquote>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0435\u043b\u043e \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u043b\u043e \u043a\u043e\u0440\u043e\u0447\u0435, \u043d\u043e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0435\u0449\u0451 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0432\u0435\u043b\u0438\u043a \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0437\u043d\u0430\u043d\u0438\u044f \u043e \u0432\u0441\u0435\u0445 \u0448\u0430\u0433\u0430\u0445).<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u0436\u0435 \u0443\u0441\u0442\u043e\u044f\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <code>Pipes &amp; Filters<\/code>.<\/p>\n<p>  <\/p>\n<h2 id=\"pipes--filters\">Pipes &amp; Filters<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/ru-ru\/azure\/architecture\/patterns\/pipes-and-filters\">\u0428\u0430\u0431\u043b\u043e\u043d \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432<\/a> <a href=\"https:\/\/medium.com\/nuances-of-programming\/%D0%BA%D1%80%D0%B0%D1%82%D0%BA%D0%B8%D0%B9-%D0%BE%D0%B1%D0%B7%D0%BE%D1%80-10-%D0%BF%D0%BE%D0%BF%D1%83%D0%BB%D1%8F%D1%80%D0%BD%D1%8B%D1%85-%D0%B0%D1%80%D1%85%D0%B8%D1%82%D0%B5%D0%BA%D1%82%D1%83%D1%80%D0%BD%D1%8B%D1%85-%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D0%BE%D0%B2-%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B9-81647be5c46f\">\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f\u043e\u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u0434\u0443<\/p>\n<p>  <\/p>\n<h3 id=\"shag-1\">\u0428\u0430\u0433 1<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0430\u0448 \u043a\u043e\u0434 \u0443\u0436\u0435 \u0431\u043b\u0438\u0437\u043e\u043a \u043a \u044d\u0442\u043e\u043c\u0443 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0448\u0430\u0433\u043e\u0432. \u041f\u043e\u043a\u0430 \u0447\u0442\u043e, \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u044d\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440, \u0430 \u0441\u0430\u043c <code>modify<\/code> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043d\u0430\u043b, \u043e\u0442\u0441\u0435\u044f\u0432 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u044e \u0433\u0440\u044f\u0437\u043d\u0443\u044e \u043e\u0434\u0435\u0436\u0434\u0443.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f: <\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public class Modifier {      private final \u0423\u0442\u044e\u0433 \u0443\u0442\u044e\u0433;     private final \u041f\u043b\u0435\u0447\u0438\u043a\u0438 \u043f\u043b\u0435\u0447\u0438\u043a\u0438;     private final \u041d\u0438\u0442\u043a\u0430\u0418\u0433\u043e\u043b\u043a\u0430 \u043d\u0438\u0442\u043a\u0430\u0418\u0433\u043e\u043b\u043a\u0430;     \/\/\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438      public Modifier(\u041f\u043b\u0435\u0447\u0438\u043a\u0438 \u043f\u043b\u0435\u0447\u0438\u043a\u0438, \u041d\u0438\u0442\u043a\u0430\u0418\u0433\u043e\u043b\u043a\u0430 \u043d\u0438\u0442\u043a\u0430\u0418\u0433\u043e\u043b\u043a\u0430, \u0423\u0442\u044e\u0433 \u0443\u0442\u044e\u0433                     \/\/\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438     ) {         this.\u0443\u0442\u044e\u0433 = \u0443\u0442\u044e\u0433;         this.\u043f\u043b\u0435\u0447\u0438\u043a\u0438 = \u043f\u043b\u0435\u0447\u0438\u043a\u0438;         this.\u043d\u0438\u0442\u043a\u0430\u0418\u0433\u043e\u043b\u043a\u0430 = \u043d\u0438\u0442\u043a\u0430\u0418\u0433\u043e\u043b\u043a\u0430;         \/\/\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438     }      public List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modify(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430) {         return \u043e\u0434\u0435\u0436\u0434\u0430.stream()                 .filter(o -&gt; !o.\u0433\u0440\u044f\u0437\u043d\u0430\u044f())                 .peek(o -&gt; {                     \u043d\u0438\u0442\u043a\u0430\u0418\u0433\u043e\u043b\u043a\u0430.\u0437\u0430\u0448\u0438\u0442\u044c(o);                     \u0443\u0442\u044e\u0433.\u0433\u043b\u0430\u0434\u0438\u0442\u044c(o);                     \u043f\u043b\u0435\u0447\u0438\u043a\u0438.\u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c(o);                     \/\/\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438                 })                 .collect(Collectors.toList());     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u043a\u043e\u0434 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445, \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0432 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 (\u0438 \u0441\u043e\u0437\u0434\u0430\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0433\u043e\u0432). \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0448\u0430\u0433\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0437\u043d\u0430\u0435\u0442 \u0432\u0441\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0438 \u0438\u043c\u0435\u0435\u0442 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u041a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0448\u0430\u0433, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u043d\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043d\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 <code>Modfier<\/code>.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-2\">\u0428\u0430\u0433 2<\/h3>\n<p>  <\/p>\n<p>\u0423\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Spring.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0448\u0430\u0433\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\"> interface Modification {     void modify(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e\u0434\u0435\u0436\u0434\u0430); } <\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0430\u043c <code>Modifier<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043e\u0447\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public class Modifier {      private final List&lt;Modification&gt; steps;      @Autowired     public Modifier(List&lt;Modification&gt; steps) {         this.steps = steps;     }      public List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modify(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430) {         return \u043e\u0434\u0435\u0436\u0434\u0430.stream()                 .filter(o -&gt; !o.\u0433\u0440\u044f\u0437\u043d\u0430\u044f())                 .peek(o -&gt; {                     steps.forEach(m -&gt; m.modify(o));                 })                 .collect(Collectors.toList());     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0448\u0430\u0433, \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>Modification<\/code> \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0434 \u043d\u0438\u043c <code>@Component<\/code>. Spring \u0441\u0430\u043c \u0435\u0433\u043e \u043d\u0430\u0439\u0434\u0451\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a.<\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c <code>Modifer<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0430\u0433\u0430\u0445, \u0437\u0430 \u0441\u0447\u0451\u0442 \u0447\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f &#171;\u0441\u043b\u0430\u0431\u0430\u044f \u0441\u0432\u044f\u0437\u044c&#187; \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u0438\u0448\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 Spring \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <code>@Order<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 int. \u0421\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e.<br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043d\u043e\u0432\u044b\u0439 \u0448\u0430\u0433 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u043e\u0432.<\/p>\n<p>  <\/p>\n<blockquote><p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0438 \u0431\u0435\u0437 Spring, \u0435\u0441\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 Modifier \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u043d\u043e \u0441\u043d\u043e\u0432\u0430 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0448\u0430\u0433\u043e\u0432.<\/p><\/blockquote>\n<p>  <\/p>\n<h3 id=\"shag-3\">\u0428\u0430\u0433 3<\/h3>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0438\u043c \u043d\u0430\u0448 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">interface Modification {     \u041e\u0434\u0435\u0436\u0434\u0430 modify(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e\u0434\u0435\u0436\u0434\u0430); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@Component @Order(Ordered.HIGHEST_PRECEDENCE) class CleanFilter implements Modification {     \u041e\u0434\u0435\u0436\u0434\u0430 modify(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e\u0434\u0435\u0436\u0434\u0430) {         if(\u043e\u0434\u0435\u0436\u0434\u0430.\u0433\u0440\u044f\u0437\u043d\u0430\u044f()){             return null;         }         return \u043e\u0434\u0435\u0436\u0434\u0430;     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0430\u043c \u0436\u0435 <code>Modifier.modify<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">    public List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; modify(List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u043e\u0434\u0435\u0436\u0434\u0430) {         return \u043e\u0434\u0435\u0436\u0434\u0430.stream()                 .map(o -&gt; {                     var modified = o;                     for(var step : steps){                         modified = step.modify(o);                         if(modified == null){                             return null;                         }                     }                     return modified;                 })                 .filter(Objects::nonNull)                 .collect(Collectors.toList());     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 <code>Modifier<\/code> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0438\u0445 \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0448\u0430\u0433 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0448\u0430\u0433\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 null, \u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043e\u0434\u0435\u0436\u0434\u044b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Spring \u0434\u043b\u044f HandlerInterceptor&#8217;\u043e\u0432. \u041f\u0435\u0440\u0435\u0434 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 URL Interceptor&#8217;\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043c\u0435\u0442\u043e\u0434 preHandle \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true \u0438\u043b\u0438 false, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u0432\u044b\u0437\u043e\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 Interceptor&#8217;\u043e\u0432<\/p>\n<p>  <\/p>\n<h3 id=\"shag-n\">\u0428\u0430\u0433 N<\/h3>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>Modification<\/code> \u043c\u0435\u0442\u043e\u0434 <code>matches<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0448\u0430\u0433\u043e\u0432 \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u0443 \u043e\u0434\u0435\u0436\u0434\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">interface Modification {     \u041e\u0434\u0435\u0436\u0434\u0430 modify(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e\u0434\u0435\u0436\u0434\u0430);     default matches(\u041e\u0434\u0435\u0436\u0434\u0430 \u043e\u0434\u0435\u0436\u0434\u0430) {return true;} }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430 \u0441\u0447\u0451\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0433\u043a\u0430 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 <code>modify<\/code>, \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 Spring (Request)Filter, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 Filter \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u043e\u0439 \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438 \u044f\u0432\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 FilterChain.doFilter \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. <\/p>\n<p>  <\/p>\n<h2 id=\"itogo\">\u0418\u0442\u043e\u0433\u043e<\/h2>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430. \u0421\u0440\u0430\u0432\u043d\u0438\u0432 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Pipes &amp; Filters \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 <code>Modifier<\/code>.<\/li>\n<li>\u041b\u0443\u0447\u0448\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043e\u0431\u044f\u0437\u0430\u043d\u043e\u0441\u0442\u0438 \u0438 &#171;\u0441\u043b\u0430\u0431\u044b\u0435&#187; \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438.<\/li>\n<li>\u041f\u0440\u043e\u0449\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0430\u0433\u0438.<\/li>\n<li>\u041f\u0440\u043e\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0448\u0430\u0433\u0438.<\/li>\n<li>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432. \u041d\u0443\u0436\u043d\u044b \u0443\u0436\u0435 IntegrationTests.<\/li>\n<li>&#171;\u0411\u043e\u043b\u044c\u0448\u0435&#187; \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0447\u0435\u043c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439.<\/p>\n<p>  <\/p>\n<p>\u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u0442 \u0436\u0435 parallelStream.<\/p>\n<p>  <\/p>\n<h3 id=\"chto-ne-reshaet-dannyy-primer\">\u0427\u0442\u043e \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h3>\n<p>  <\/p>\n<ol>\n<li>\u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 (\u043a\u0430\u043d\u0430\u043b).<br \/> \n<ul>\n<li>\u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>@Qualifier<\/code>.<\/li>\n<li>\u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0437\u0430\u0434\u0430\u0442\u044c \u0438\u043d\u043e\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>@Order<\/code>, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/li>\n<\/ul>\n<\/li>\n<li>\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043f\u043e\u0447\u0435\u043a, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u044b\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438, \u0438 \u0432\u0441\u0451 \u0442\u0430\u043a\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0443\u044e\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.<br \/> \n<ul>\n<li>\u0422\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0434\u0430\u0447\u0430: &#171;\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0441\u043a\u0430 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 &lt;? extends \u041e\u0434\u0435\u0436\u0434\u0430&gt;&#187; \u043f\u043b\u043e\u0445\u043e \u0432\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0442.\u043a. \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0441\u043a\u0430 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0451 \u0431\u0435\u043b\u044c\u0451 \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 List&lt;\u041e\u0434\u0435\u0436\u0434\u0430&gt; \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043d\u043e\u0432\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443. \u041d\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b\u043c \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0441\u0430\u043c\u0438\u0445 \u0446\u0435\u043f\u043e\u0447\u0435\u043a, \u0435\u0441\u043b\u0438 \u043d\u043e\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0448\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043e\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>  <\/p>\n<h2 id=\"spasibo-za-vnimanie\">\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/h2>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/479464\/\"> https:\/\/habr.com\/ru\/post\/479464\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/479464\/\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Pipes &amp; Filters.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0437\u0436\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0448\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DI (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Spring).<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0435.<br \/>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0438 \u043f\u043e\u0434\u0432\u0435\u0434\u0451\u043c \u0438\u0442\u043e\u0433.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-295560","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295560"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295560\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}