If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

20. Java 8+

  1. Review the presentation Java 8+

Tasks

  1. Review the package jtm.activity20
  2. Create an entry RandomPerson
  3. Add new methods to the PersonMatcher interface:
    1. Method Stream<RandomPerson> getPersonStream()
    2. default method Stream<RandomPerson> getMatchedPersonStream() with parameters:

      • Stream<RandomPerson> persons,
      • boolean isFemale,
      • int ageFrom,
      • int ageTo,
      • float weightFrom,
      • float weightTo

      This method should return a Stream with the passed persons filtered according to the passed gender, age range, and weight range (including). Tip: You can use stream filter model.

    3. static method List<RandomPerson> getPersonList(Stream<RandomPerson> persons)
    4. static method PersonMatcher getPersonManager()
    5. Implement the default and static method in the PersonMatcher interface.
  4. Create a class PersonMatcherImpl that implements the PersonMatcher interface and implement its methods:
    1. public constructor PersonMatcherImpl()
    2. public void addPerson(RandomPerson person)
    3. public List<RandomPerson> getPersonList()
    4. public Stream<RandomPerson> getPersonStream()
      Tip: You can use Stream.Builder.

  5. Verify that the unit tests for the jtm.activity20 package pass.

  

Created by Valdis Vītoliņš on 2025-01-28 17:51
Last modified by Valdis Vītoliņš on 2025-01-28 17:51
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License