Merge pull request #723 from Juaanma/patch-1

Captain is implementing RowingBoat - Adapter pattern
This commit is contained in:
Ilkka Seppälä authored and GitHub committed 2018-03-11 21:59:13 +02:00
commit c723289bbb
2 files changed
+2 -3

No files matched your search

@@ -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();