### Question:
ForcesMoves extends Forces { public String getDirection() { return direction.toString(); } ForcesMoves(Point region, int count, QDirection direction);  ForcesMoves(JSONObject json); String getDirection(); Point getDestination(Point from);  }### Answer:
@Test public void testParse() { JSONObject json = new JSONObject("{region:{x:3, y:4}, direction:'left_down', count:2}"); ForcesMoves forces = new ForcesMoves(json); assertEquals(2, forces.getCount()); assertEquals(QDirection.LEFT_DOWN.name(), forces.getDirection()); assertEquals("[3,4]", forces.getRegion().toString()); }
@Test public void testParse_withoutDirection() { JSONObject json = new JSONObject("{region:{x:-1, y:-5}, count:2}"); ForcesMoves forces = new ForcesMoves(json); assertEquals(2, forces.getCount()); assertEquals(QDirection.NONE.name(), forces.getDirection()); assertEquals("[-1,-5]", forces.getRegion().toString()); }
@Test public void testParse_upperCaseDirection() { JSONObject json = new JSONObject("{region:{x:3, y:4}, direction:'LEFT_DOWN', count:2}"); ForcesMoves forces = new ForcesMoves(json); assertEquals(2, forces.getCount()); assertEquals(QDirection.LEFT_DOWN.name(), forces.getDirection()); assertEquals("[3,4]", forces.getRegion().toString()); }