From d1cb0386ba8ee77bb957c37f13dc82ccf10155fb Mon Sep 17 00:00:00 2001 From: JPANZO Date: Wed, 9 Feb 2022 20:00:48 +0100 Subject: [PATCH] Productive code for case:1 of method-test next created. --- src/main/java/device/cdPlayer/CDPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/device/cdPlayer/CDPlayer.java b/src/main/java/device/cdPlayer/CDPlayer.java index 209e646..ff1caf2 100644 --- a/src/main/java/device/cdPlayer/CDPlayer.java +++ b/src/main/java/device/cdPlayer/CDPlayer.java @@ -42,7 +42,10 @@ public class CDPlayer implements Device { @Override public void next() { + List playList = Arrays.asList(loadedCD.getPlayList()); + int indexOfActualPlayTrack=playList.indexOf(actualPlayTrack); + this.actualPlayTrack=playList.get(indexOfActualPlayTrack +1); } @Override @@ -115,7 +118,8 @@ public class CDPlayer implements Device { } public String getSongByNumber(int songNr){ - return ""; + List playList = Arrays.asList(loadedCD.getPlayList()); + return playList.get(songNr); } public String getActualPlayTrack() {