Skip to content

Commit c723289

Browse files
authored
Merge pull request iluwatar#723 from Juaanma/patch-1
Captain is implementing RowingBoat - Adapter pattern
2 parents 477da92 + 87cb33f commit c723289

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

adapter/src/main/java/com/iluwatar/adapter/Captain.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* The Captain uses {@link RowingBoat} to sail. <br>
2727
* This is the client in the pattern.
2828
*/
29-
public class Captain implements RowingBoat {
29+
public class Captain {
3030

3131
private RowingBoat rowingBoat;
3232

@@ -40,7 +40,6 @@ public void setRowingBoat(RowingBoat rowingBoat) {
4040
this.rowingBoat = rowingBoat;
4141
}
4242

43-
@Override
4443
public void row() {
4544
rowingBoat.row();
4645
}

adapter/src/test/java/com/iluwatar/adapter/AdapterPatternTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void setup() {
6666
*/
6767
@Test
6868
public void testAdapter() {
69-
RowingBoat captain = (RowingBoat) beans.get(ROWING_BEAN);
69+
Captain captain = (Captain) beans.get(ROWING_BEAN);
7070

7171
// when captain moves
7272
captain.row();

0 commit comments

Comments
 (0)