Usa extends Graph { public ArrayList<State> getNeighbouringStates(State state, int distance){ ArrayList<State> result = limitedBFSSearch(state,distance); this.resetMarked(); return result; } Usa(); State findStateByState(State s); State findStateByStateName(String s); State findStateByCity(City c); ArrayList<State> getNeighbouringStates(State state, int distance); int getHops(State state, State state2); ArrayList<City> findLowestCrimeRate(ArrayList<State> states,int length); ArrayList<City> findLowestCrimeRate(int length); void addCity(String c); boolean containsState(State state); void printUSA(); static void main(String[] args); static final int FIND_STATE_BY_STATE_FLAG; static final int FIND_STATE_BY_CITY_FLAG; static final int FIND_LOWEST_CRIME_RATE_FLAG; static final int ADD_CITY_FLAG; static final int FIND_STATE_BY_STATE_NAME_FLAG; }
@Test public void testBFSNeighbours() { ArrayList<State> states = usa.getNeighbouringStates(NY, 5); assertTrue(testLimitedBFS(NY,states,5)); }