[No Audio]
So, getting back to the code we were looking
at before we configured the Maven compiler plugin,
let's just do a quick bit of tidy up.
Let's just say we do a stream
here, then a filter and then .collect.
To me that's more kind of readable here as a best
practice because we end up with this is the method
which has been executed in the data layer
to get all the users.
This is telling us that we're using the Java Extremes
API to do some slicing and dicing of data.
Then basically we have each intermediate operation
underneath that on its online so that we can very
clearly see how that pipeline has been executed.
In this case it's just doing a filter operation to
say filter out users that are live REGULAR_USERS.
And then finally we have the terminal operation
which in this case is a collect, to
collect those elements into a set.
So when this method here is
executed, just get rid of RegularUsers.
Expect that we get a set containing
[No Audio]
these three users here because they're RegularUsers.
As we can see,
[No Audio]
now let's do a similar thing for the AdminUsers.
[No Audio]
So getAdminUsers same kind of
thing, it's just this ADMIN_USER.
So that's nice from a functional perspective since
we've now got two methods to be able to return a
different types of users that we have in the system.
But we can go further with this
which we'll do in the next videos.