CaptureSuggester implements Suggester { @Override public ShortSet getMoves() { movesToCapture.clear(); final ShortSet chainsInAtari = atari.getChainsInAtari(board.getColorToPlay() .opposite()); for (int i = 0; i < chainsInAtari.size(); i++) { movesToCapture.add(board.getLiberties(chainsInAtari.get(i)).get(0)); } return movesToCapture; } CaptureSuggester(Board board, AtariObserver atari);  CaptureSuggester(Board board, AtariObserver atari, int bias); @Override int getBias(); @Override ShortSet getMoves();  }
@Test public void testGet() { String[] diagram = { "O#...", "....#", "...#O", ".....", ".....", }; board.setUpProblem(diagram, BLACK); assertTrue(movesToCapture.getMoves().contains(at("e2"))); assertTrue(movesToCapture.getMoves().contains(at("a4"))); }
@Test public void testMultipleCaptures() { String[] diagram = { ".#O#.", "##O##", "OO.OO", "##O##", ".#O#.", }; board.setUpProblem(diagram, BLACK); assertEquals(1, movesToCapture.getMoves().size()); assertTrue(movesToCapture.getMoves().contains(at("c3"))); }