IdUtil { public static void validateStoreId(String storeId) throws InvalidIdException { try { Integer.parseInt(storeId); } catch (NumberFormatException ex) { throw new InvalidIdException("StoreId [" + storeId + "] is not valid: " + ex.getMessage()); } } private  IdUtil(); static void validateSpaceId(String spaceID); static void validateContentId(String contentID); static void validateStoreId(String storeId);  }
@Test public void testStoreIds() throws Exception { IdUtil.validateStoreId("1000"); try { String storeId = "abc"; IdUtil.validateStoreId(storeId); fail("Exception expected attempting to validate store id: " + storeId); } catch (Exception ex) { Assert.assertTrue(true); } }