### Question:
DecimalDegreesLongitudeValidator implements Validator { @Override public boolean isValid(String value) { try { Double doubleValue = Double.parseDouble(value); return doubleValue <= 180 && doubleValue >= -180; } catch (NumberFormatException e) { return false; } }  @Override boolean isValid(String value);  }### Answer:
@Test public void testGoodData() { assertTrue(validator.isValid("-179.3333333333333333")); assertTrue(validator.isValid("179")); assertTrue(validator.isValid("0")); assertTrue(validator.isValid("89.555553")); assertTrue(validator.isValid("-180")); }
@Test public void testBadData() { assertTrue(!validator.isValid("33q")); assertTrue(!validator.isValid("-181")); assertTrue(!validator.isValid("190")); assertTrue(!validator.isValid("180.0000000001")); }