Map<HexagonOrientation, Map<Neighbor, Shift>> table = new HashMap<HexagonOrientation, Map<Neighbor, Shift>>();
table.put(HexagonOrientation.FLAT, flatShifts);
table.put(HexagonOrientation.ANGLED, angledShifts);
for (HexagonOrientation o : HexagonOrientation.values()) {
PolygonBuilder gridBuilder =
o == HexagonOrientation.ANGLED ? angledBuilder : flatBuilder;
Hexagon h0 = Hexagons.create(0.0, 0.0, SIDE_LEN, o, null);
for (Neighbor n : Neighbor.values()) {
boolean expectEx = !gridBuilder.isValidNeighbor(n);
boolean gotEx = false;
try {
hn = (Hexagon) gridBuilder.createNeighbor(h0, n);
} catch (IllegalArgumentException ex) {
gotEx = true;
}
assertEquals("Failed for case " + o + " " + n, expectEx, gotEx);