Skip to content

Instantly share code, notes, and snippets.

@Jayasagar
Created December 17, 2017 15:08
Show Gist options
  • Save Jayasagar/4d57e0b5a47073d5943e5db42beadb4f to your computer and use it in GitHub Desktop.
Save Jayasagar/4d57e0b5a47073d5943e5db42beadb4f to your computer and use it in GitHub Desktop.
Java Stream Test Data
List<Event> bulbEvents = Arrays.asList(Event.builder().name("switchedOn").isActive(true).build(), Event.builder().name("switchedOff").isActive(true).build());
List<Event> motionDetectorEvents = Arrays.asList(Event.builder().name("motionCaptured").isActive(true).build());
List<Event> eyeVirusEvents = Arrays.asList(Event.builder().name("virusFound").isActive(true).build());
List<Event> waterLevelsEvents = Arrays.asList(Event.builder().name("dryField").isActive(true).build());
Thing bulb = Thing.builder().name("Bulb").cost(120).isRunning(true).type(Type.HOME).events(bulbEvents).build();
Thing motionDetector = Thing.builder().name("MotionDetector").cost(60).isRunning(true).type(Type.HOME).events(motionDetectorEvents).build();
Thing eyeVirusDetector = Thing.builder().name("EyeVirusDetector").cost(200).isRunning(true).type(Type.HEALTH).events(eyeVirusEvents).build();
Thing agriFieldSensor = Thing.builder().name("AgriFieldSensor").cost(300).isRunning(true).type(Type.FIELD).events(eyeVirusEvents).build();
Consumer malli = Consumer.builder().age(25).city("Hyd").name("Malli").things(Arrays.asList(bulb, motionDetector)).build();
Consumer sri = Consumer.builder().age(32).city("Hyd").name("Sri").things(Arrays.asList(bulb, eyeVirusDetector)).build();
Consumer satti = Consumer.builder().age(21).city("Hyd").name("Satti").things(Arrays.asList(agriFieldSensor, motionDetector)).build();
Consumer bob = Consumer.builder().age(35).city("Berlin").name("Bob").things(Arrays.asList(bulb, motionDetector, agriFieldSensor, eyeVirusDetector)).build();
List<Consumer> consumerList = Arrays.asList(malli, sri, satti, bob);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment