title: Returning boolean instead of list
body: <ol>
  <li>user class with fields id, name and types</li>
  </ol>
  
  <pre><code>public class User {
      private String id;
      private String name;
      private List&lt;Types&gt; types;
  }
  </code></pre>
  
  <ol start="2">
  <li>Types class with fields id, name , linkedTo</li>
  </ol>
  
  <pre><code>{
      private String id;
      private String name;
      private String linkedTo;
  
  }
  </code></pre>
  
  <ol start="3">
  <li>Implemented a method to get types from user and return it as list</li>
  </ol>
  
  <pre><code>private List&lt;Types&gt; getType(List&lt;User&gt; Users) {
          return Users
                  .stream()
                  .map(User::gettypes)
                  .flatMap(List::stream)
                  .collect(Collectors.toList());
      }}
  </code></pre>
  
  <ol start="4">
  <li>Now, have to map to response body. For that I have response class:</li>
  </ol>
  
  <pre><code>    public class UserResponse {
  
      private String id;
      private String type;
      private String name;
      private String linkedTo;
  
  }
  </code></pre>
  
  <ol start="5">
  <li>Have to map the fields from Types to user response to return it as list</li>
  </ol>
  
  <pre><code>private List&lt;UserResponse&gt; getUserResponse(UserRequest request) {
          List&lt;User&gt; Users = userServiceClient.getById();
          List&lt;UserResponse&gt; userResponses = new ArrayList&lt;&gt;();
          List&lt;Types&gt; TypesList = getType(Users);
              if (!typesList.isEmpty()) {
              return typesList.stream()
                      .map(type -&gt; userResponses.add(new UserResponse( type.getGuid(),type.getName(),type.getName(),type.getLinkedTo())))
                          .collect(Collectors.toList());
      }
     return collections.emptylist();
      }
  </code></pre>
  
  <p>Here is the problem, I'm not able to return it as list instead getting a boolean..</p>
  
  <p>Is there any efficient way to do this? The code reviewer doesn't want me to use for each and return the list</p>