@Test public void whenGetAlivePlayers() { for (int i = 0; i < 10; i++) { putPlayer(i % 2 == 0); } assertEquals(5, storage.getAlivePlayerCount()); }
@Override public long getAlivePlayerCount() { return storage.values().stream().filter(x -> x.getStatus().isAlive()).count(); }
VirtualGamePlayerStorage implements GamePlayerStorage<P> { @Override public long getAlivePlayerCount() { return storage.values().stream().filter(x -> x.getStatus().isAlive()).count(); } }
VirtualGamePlayerStorage implements GamePlayerStorage<P> { @Override public long getAlivePlayerCount() { return storage.values().stream().filter(x -> x.getStatus().isAlive()).count(); }  }
VirtualGamePlayerStorage implements GamePlayerStorage<P> { @Override public long getAlivePlayerCount() { return storage.values().stream().filter(x -> x.getStatus().isAlive()).count(); }  @Override P getPlayer(UUID player); @Override void addPlayer(UUID player, P gamePlayer); @Override void removePlayer(UUID player); @Override Collection<P> getAllPlayers(); @Override long getAlivePlayerCount(); @Override boolean contains(UUID uuid); }
VirtualGamePlayerStorage implements GamePlayerStorage<P> { @Override public long getAlivePlayerCount() { return storage.values().stream().filter(x -> x.getStatus().isAlive()).count(); }  @Override P getPlayer(UUID player); @Override void addPlayer(UUID player, P gamePlayer); @Override void removePlayer(UUID player); @Override Collection<P> getAllPlayers(); @Override long getAlivePlayerCount(); @Override boolean contains(UUID uuid);  }