@Test public void whenVoteForInexistentMapThenNotAccepted() { Assert.assertEquals(UnknownMapResult.class, voting.vote("something").getClass()); }
public MapVotingResult vote(String mapName) { return gameMaps.getMap(mapName) .map(this::successfulVoting) .orElseGet(() -> new UnknownMapResult(mapName)); }
GameMapVoting { public MapVotingResult vote(String mapName) { return gameMaps.getMap(mapName) .map(this::successfulVoting) .orElseGet(() -> new UnknownMapResult(mapName)); } }
GameMapVoting { public MapVotingResult vote(String mapName) { return gameMaps.getMap(mapName) .map(this::successfulVoting) .orElseGet(() -> new UnknownMapResult(mapName)); }  }
GameMapVoting { public MapVotingResult vote(String mapName) { return gameMaps.getMap(mapName) .map(this::successfulVoting) .orElseGet(() -> new UnknownMapResult(mapName)); }  MapVotingResult vote(String mapName); Optional<GameMap> getVotingWinner(); void close(); boolean isOpen(); }
GameMapVoting { public MapVotingResult vote(String mapName) { return gameMaps.getMap(mapName) .map(this::successfulVoting) .orElseGet(() -> new UnknownMapResult(mapName)); }  MapVotingResult vote(String mapName); Optional<GameMap> getVotingWinner(); void close(); boolean isOpen();  }