Merge pull request #723 from Juaanma/patch-1

Captain is implementing RowingBoat - Adapter pattern
This commit is contained in:
Ilkka Seppälä 2018-03-11 21:59:13 +02:00 committed by GitHub
commit c723289bbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -26,7 +26,7 @@ package com.iluwatar.adapter;
* The Captain uses {@link RowingBoat} to sail. <br> * The Captain uses {@link RowingBoat} to sail. <br>
* This is the client in the pattern. * This is the client in the pattern.
*/ */
public class Captain implements RowingBoat { public class Captain {
private RowingBoat rowingBoat; private RowingBoat rowingBoat;
@ -40,7 +40,6 @@ public class Captain implements RowingBoat {
this.rowingBoat = rowingBoat; this.rowingBoat = rowingBoat;
} }
@Override
public void row() { public void row() {
rowingBoat.row(); rowingBoat.row();
} }

View File

@ -66,7 +66,7 @@ public class AdapterPatternTest {
*/ */
@Test @Test
public void testAdapter() { public void testAdapter() {
RowingBoat captain = (RowingBoat) beans.get(ROWING_BEAN); Captain captain = (Captain) beans.get(ROWING_BEAN);
// when captain moves // when captain moves
captain.row(); captain.row();