@Test(expected = IllegalArgumentException.class) public void shouldThrowIllegalArgumentExceptionOnEmptyCurrentPath() throws Exception { String currentPath = ""; PathBuilder.appendToMap(currentPath, "home"); }
public static String appendToMap(String current, String key) { if (!StringUtils.hasText(current) || !StringUtils.hasText(key)) throw new IllegalArgumentException("Current path and key connot be null or empty"); return String.format(MAP_FORMAT, current, key); }
PathBuilder { public static String appendToMap(String current, String key) { if (!StringUtils.hasText(current) || !StringUtils.hasText(key)) throw new IllegalArgumentException("Current path and key connot be null or empty"); return String.format(MAP_FORMAT, current, key); } }
PathBuilder { public static String appendToMap(String current, String key) { if (!StringUtils.hasText(current) || !StringUtils.hasText(key)) throw new IllegalArgumentException("Current path and key connot be null or empty"); return String.format(MAP_FORMAT, current, key); } private  PathBuilder(); }
PathBuilder { public static String appendToMap(String current, String key) { if (!StringUtils.hasText(current) || !StringUtils.hasText(key)) throw new IllegalArgumentException("Current path and key connot be null or empty"); return String.format(MAP_FORMAT, current, key); } private  PathBuilder(); static String appendTo(String current, int index); static String appendToMap(String current, String key); static String appendTo(String current, String fieldName); }
PathBuilder { public static String appendToMap(String current, String key) { if (!StringUtils.hasText(current) || !StringUtils.hasText(key)) throw new IllegalArgumentException("Current path and key connot be null or empty"); return String.format(MAP_FORMAT, current, key); } private  PathBuilder(); static String appendTo(String current, int index); static String appendToMap(String current, String key); static String appendTo(String current, String fieldName);  }