Merge pull request #723 from Juaanma/patch-1
Captain is implementing RowingBoat - Adapter pattern
This commit is contained in:
		@@ -26,7 +26,7 @@ package com.iluwatar.adapter;
 | 
			
		||||
 * The Captain uses {@link RowingBoat} to sail. <br>
 | 
			
		||||
 * This is the client in the pattern.
 | 
			
		||||
 */
 | 
			
		||||
public class Captain implements RowingBoat {
 | 
			
		||||
public class Captain {
 | 
			
		||||
 | 
			
		||||
  private RowingBoat rowingBoat;
 | 
			
		||||
 | 
			
		||||
@@ -40,7 +40,6 @@ public class Captain implements RowingBoat {
 | 
			
		||||
    this.rowingBoat = rowingBoat;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @Override
 | 
			
		||||
  public void row() {
 | 
			
		||||
    rowingBoat.row();
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@ public class AdapterPatternTest {
 | 
			
		||||
   */
 | 
			
		||||
  @Test
 | 
			
		||||
  public void testAdapter() {
 | 
			
		||||
    RowingBoat captain = (RowingBoat) beans.get(ROWING_BEAN);
 | 
			
		||||
    Captain captain = (Captain) beans.get(ROWING_BEAN);
 | 
			
		||||
 | 
			
		||||
    // when captain moves
 | 
			
		||||
    captain.row();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user