// Check if the parameterized territory is a neighbor and returns the neighbor or null public Territory IsNeighbor(String neighborName) { for (Territory t : neighbors) { if (t.getTerritoryName().equals(neighborName)) { return t; } } return null; }