Created
November 26, 2019 18:50
-
-
Save SamiMohsin/b8efc5e85cd6630dd2b7abc4bfe70e83 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Random; | |
| public class RssFeedProvider { | |
| public static List<RssItem> parse(String rssFeed) { | |
| List<RssItem> list = new ArrayList<>(); | |
| Random r = new Random(); | |
| // random number of item but at least 5 | |
| Integer number = r.nextInt(10) + 5; | |
| for (int i = 0; i < number; i++) { | |
| // create sample data | |
| String s = String.valueOf(r.nextInt(1000)); | |
| RssItem item = new RssItem("Summary " + s, "Description " + s); | |
| list.add(item); | |
| } | |
| return list; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment