@Test public void find() throws Exception { controller.find(); }
public CompletionStage<LobbyController> find() { return lobbies().thenApply(lobbies -> lobbies.stream() .filter(lobby -> lobby.getStatus().equals(LobbyStatus.INTERMISSION)) .filter(lobby -> lobby.getTeams().size() < lobby.getConfiguration() .getTeamMaximum()) .findFirst() .get() ) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); }
LobbyBalancerController { public CompletionStage<LobbyController> find() { return lobbies().thenApply(lobbies -> lobbies.stream() .filter(lobby -> lobby.getStatus().equals(LobbyStatus.INTERMISSION)) .filter(lobby -> lobby.getTeams().size() < lobby.getConfiguration() .getTeamMaximum()) .findFirst() .get() ) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); } }
LobbyBalancerController { public CompletionStage<LobbyController> find() { return lobbies().thenApply(lobbies -> lobbies.stream() .filter(lobby -> lobby.getStatus().equals(LobbyStatus.INTERMISSION)) .filter(lobby -> lobby.getTeams().size() < lobby.getConfiguration() .getTeamMaximum()) .findFirst() .get() ) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); } LobbyBalancerController(Client client); }
LobbyBalancerController { public CompletionStage<LobbyController> find() { return lobbies().thenApply(lobbies -> lobbies.stream() .filter(lobby -> lobby.getStatus().equals(LobbyStatus.INTERMISSION)) .filter(lobby -> lobby.getTeams().size() < lobby.getConfiguration() .getTeamMaximum()) .findFirst() .get() ) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); } LobbyBalancerController(Client client); CompletionStage<Set<Lobby>> lobbies(); CompletionStage<Set<LobbyController>> controllers(); CompletionStage<Lobby> lobby(String id); CompletionStage<LobbyController> controller(String id); LobbyController controller(Lobby lobby); CompletionStage<LobbyController> find(); }
LobbyBalancerController { public CompletionStage<LobbyController> find() { return lobbies().thenApply(lobbies -> lobbies.stream() .filter(lobby -> lobby.getStatus().equals(LobbyStatus.INTERMISSION)) .filter(lobby -> lobby.getTeams().size() < lobby.getConfiguration() .getTeamMaximum()) .findFirst() .get() ) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); } LobbyBalancerController(Client client); CompletionStage<Set<Lobby>> lobbies(); CompletionStage<Set<LobbyController>> controllers(); CompletionStage<Lobby> lobby(String id); CompletionStage<LobbyController> controller(String id); LobbyController controller(Lobby lobby); CompletionStage<LobbyController> find();  }