class RetrieveLocationsUseCase implements RetrieveLocationsInputPort {

    @Override
    public void retrieveLocations(final RetrieveLocationsInputData inputData,
        final RetrieveLocationsOutputPort outputPort) {
        final Iterable<Location> locations = gatewaysAccessor.getLocationGateway().findAll();

        final RetrieveLocationsOutputData retrieveLocationsOutputData = new RetrieveLocationsOutputData();
        final List<RetrieveLocationsOutputData.Location> outputLocations = retrieveLocationsOutputData
            .getLocations();
        locations.forEach(l -> {
            final RetrieveLocationsOutputData.Location outputLocation = retrieveLocationsOutputData.new Location();
            outputLocation.setName(l.getName());
            outputLocation.setAddress(l.getAddress());
            outputLocations.add(outputLocation);
        });

        outputPort.present(retrieveLocationsOutputData);
    }

    public  RetrieveLocationsUseCase(final GatewaysAccessor gatewaysAccessor);

}