title: How to write this logic, made in C#, in Java? What the types of the returns in C#?
body: <p>I have an C# API and just need to port it to Spring API (Java), but I'm having trouble with some logics of C# language.
  Here's both codes in C# and Java.</p>
  
  <p>C# (the important is the method [Route("ClienteSemSaldo")]:</p>
  
  <pre><code>    namespace Web.Api.Rest.Controllers
  {
      [Route("api/[controller]")]
      [ApiExplorerSettings(IgnoreApi = false)]
      public class RcClienteController : Controller
      {
          private readonly IRcClienteService _service;
          private readonly IRcClienteProdutoService _serviceProduto;
          private string _userId;
          private string _userTipo;
          private static readonly ILog log = LogManager.GetLogger(typeof(RcClienteController));
  
          public RcClienteController(IRcClienteService service, IRcClienteProdutoService serviceProduto)
          {
              _service = service;
              _serviceProduto = serviceProduto;
              _userTipo = "E";
          }
  
          [HttpGet]
          [ProducesResponseType(typeof(RcCliente), 200)]
          public async Task&lt;IActionResult&gt; Get([FromQuery]string cliente)
          {
              try
              {
                  _userId = User.Claims.FirstOrDefault(c =&gt; c.Type == ClaimTypes.NameIdentifier).Value;
                  var t = await _service.BuscarCliente(_userId, _userTipo, cliente);
                  return Ok(t);
              }
              catch (Exception ex)
              {
                  log.Error(ex);
                  return BadRequest(ex.Message);
              }
          }
  
          [HttpGet]
          [Route("ClienteSemSaldo")]
          [ProducesResponseType(typeof(RcCliente), 200)]
          public async Task&lt;IActionResult&gt; ClienteSemSaldo()
          {
              try
              {
                  _userId = User.Claims.FirstOrDefault(c =&gt; c.Type == ClaimTypes.NameIdentifier).Value;
  
                  var posicoes = await _serviceProduto.BuscarClienteProduto(_userId, _userTipo, null, null);
                  var clientes = await _service.BuscarCliente(_userId, _userTipo, null);
  
                  var t = clientes.Where(a =&gt; !posicoes.Any(b =&gt; b.ClienteId == a.ClienteId)).ToList();
                  return Ok(t);
              }
              catch (Exception ex)
              {
                  log.Error(ex);
                  return BadRequest(ex.Message);
              }
          }
  
      }
  }
  </code></pre>
  
  <p>Java (the important is the method getClienteSemSaldo):</p>
  
  <pre><code>@RequestMapping("/customer")
  @RestController
  public class CustomerController implements ICustomerController{
  
      private final String _userTipo = "E";
  
      @Autowired
      private ICustomerService customerService;
  
      @Autowired
      private ICustomerProductService customerProductService;
  
  
      @GetMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
      public ResponseEntity&lt;List&lt;CustomerResponse&gt;&gt; getCliente(@RequestParam String cliente) throws Exception {
  
          Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
          String idUser = authentication.getName();
  
          List&lt;CustomerResponse&gt; lista = customerService.getCliente(cliente, idUser, _userTipo);
          return new ResponseEntity&lt;List&lt;CustomerResponse&gt;&gt;(lista, HttpStatus.OK);
      }
  
      @GetMapping(path="/withoutbalance", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
      public ResponseEntity&lt;List&lt;CustomerProductResponse&gt;&gt; getClienteSemSaldo() throws Exception {
  
          Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
          String idUser = authentication.getName();
  
          List&lt;CustomerProductResponse&gt; posicoes = customerProductService.getClienteProduto(null, idUser, _userTipo, null);
          List&lt;CustomerResponse&gt; clientes = customerService.getCliente(null, idUser, _userTipo);
  
          List&lt;CustomerProductResponse&gt; lista = posicoes.stream()
                                          .filter(a -&gt; !posicoes.stream().anyMatch(b -&gt; b.clienteId == a.clienteId))
                                          //.map(b -&gt; new CustomerProductResponse())
                                          .collect(Collectors.toList());
  
          return new ResponseEntity&lt;List&lt;CustomerProductResponse&gt;&gt;(lista, HttpStatus.OK);
      }
  
  }
  </code></pre>
  
  <p>So the method getClienteSemSaldo must return</p>
  
  <pre><code>List&lt;CustomerProductResponse&gt;
  </code></pre>
  
  <p>And not</p>
  
  <pre><code>List&lt;CustomerResponse&gt;
  </code></pre>
  
  <p>Right? How to do that?</p>