title: Java - Gherkin & Cucumber: Pass an object or list of objects on a vertical table instead of horizontal
body: <p>I have the following sample gherkin scenario on my feature file:</p>
  
  <pre><code>Scenario: Book an FX Trade
   Given trades with the following details are created:
     |buyCcy |sellCcy |amount   |date       |
     |EUR    |USD     |12345.67 |23-11-2017 |
     |GBP    |EUR     |67890.12 |24-11-2017 |
   When the trades are executed
   Then the trades are confirmed
  </code></pre>
  
  <p>In my glue file, I can map the data table to an object <code>Trade</code> as an out of the box cucumber solution:</p>
  
  <pre><code>@When("^trades with the following details are created:$")
  public void trades_with_the_following_details_are_created(List&lt;Trade&gt; arg1) throws Throwable {
          //do something with arg1
  }
  </code></pre>
  
  <p><strong>What I want to achieve:</strong><br>
  Improve the readability of my gherkin scenario by doing the following:
      <li> Transpose the data table vertically, This will improve readability if my object has around 10 fields
      <li> Replace fields / column names with aliases</p>
  
  <p><strong>Sample:</strong><br></p>
  
  <pre><code>Scenario: Book an FX Trade
   Given trades with the following details are created:
     |Buy Currency  | EUR        | GBP        |
     |Sell Currency | USD        | EUR        |
     |Amount        | 12345.67   | 67890.12   |
     |Date          | 23-11-2017 | 24-11-2017 |
   When the trades are executed
   Then the trades are confirmed
  </code></pre>
  
  <p>I want the table to be dynamic in a way that it can have more or less than 2 data sets / columns. What would be the best way to achieve this?</p>
  
  <p><strong>Additional info:</strong><br>
  Language: Java 8<br>
  Cucumber version: 1.2.5<br></p>
  
  <p><code>Trade</code> POJO being something like:</p>
  
  <pre><code>public class Trade {
      private String buyCcy;
      private String sellCcy;
      private String amount;
      private String date;
  
      /**
       * These fields are growing and may have around 10 or more....
       * private String tradeType;
       * private String company;
       */
  
      public Trade() {
      }
  
      /**
       * accessors here....
       */
  }
  </code></pre>