### Question:
ZxtmNameHelper { public static Integer stripLbIdFromZxtmName(String zxtmName) throws NumberFormatException, ArrayIndexOutOfBoundsException { return Integer.valueOf(zxtmName.split("_")[1]); }  static Integer stripAccountIdFromZxtmName(String zxtmName); static Integer stripLbIdFromZxtmName(String zxtmName); static Map<Integer, Integer> stripLbIdAndAccountIdFromZxtmName(List<String> loadBalancerNames); static Map<Integer, Integer> stripLbIdAndAccountIdFromZxtmName(Collection<LoadBalancerNameMap> loadBalancerNameMaps); static final Log LOG; }### Answer:
@Test public void shouldReturnLoadBalancerIdFromZxtmName() { String zxtmName = "1234_56"; Integer lbId = ZxtmNameHelper.stripLbIdFromZxtmName(zxtmName); Assert.assertEquals(new Integer(56), lbId); }
@Test(expected = NumberFormatException.class) public void shouldThrowNumberFormatExceptionWhenStrippingLbIdFromBadName() { String badZxtmName = "Evil_load_balancer_name"; ZxtmNameHelper.stripLbIdFromZxtmName(badZxtmName); }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void shouldThrowArrayIndexOutOfBoundsExceptionWhenStrippingLbIdFromBadName() { String badZxtmName = "Evil load balancer name"; ZxtmNameHelper.stripLbIdFromZxtmName(badZxtmName); }