From d29975feb91bca7f327feadd0056bf88c55a8e94 Mon Sep 17 00:00:00 2001 From: John Sanda Date: Mon, 11 May 2015 11:15:41 -0400 Subject: [PATCH] completed exercises --- .../learnrxjava/ComposableListExercises.java | 148 +++++++++++------- .../java/learnrxjava/ObservableExercises.java | 41 +++-- .../learnrxjava/types/ComposableList.java | 18 ++- 3 files changed, 134 insertions(+), 73 deletions(-) diff --git a/src/main/java/learnrxjava/ComposableListExercises.java b/src/main/java/learnrxjava/ComposableListExercises.java index a13940c..193b36a 100644 --- a/src/main/java/learnrxjava/ComposableListExercises.java +++ b/src/main/java/learnrxjava/ComposableListExercises.java @@ -127,11 +127,11 @@ public ComposableList map(Function projectionFunction) { // Note that you can apply a projectionFunction to a value like this: // projectionFunction.apply(5) // ------------ INSERT CODE HERE! ---------------------------- - + results.add(projectionFunction.apply(itemInList)); }); - //return results; - throw new UnsupportedOperationException("Not implemented yet."); + return results; +// throw new UnsupportedOperationException("Not implemented yet."); } /* @@ -146,10 +146,10 @@ public static ComposableList exercise5() { new Video(654356453, "Bad Boys", 5.0), new Video(65432445, "The Chamber", 4.0), new Video(675465, "Fracture", 5.0)); - - // complete this expression - // return newReleases.map(video -> - throw new UnsupportedOperationException("Not implemented yet."); + + // complete this expression + return newReleases.map(video -> json("id", video.id, "title", video.title)); +// throw new UnsupportedOperationException("Not implemented yet."); } /* @@ -189,11 +189,13 @@ public static ComposableList