### Question:
ManagedUtils { public static String createLabel( String name ) { CheckArg.isNotNull(name, "name"); name = name.replaceFirst("option.", ""); name = name.replaceFirst("custom.", ""); name = name.replace(".", " "); String label = null; Inflector inflector = Inflector.getInstance(); if (name != null) { label = inflector.titleCase(inflector.humanize(name)); label = label.replaceFirst("Jcr", "JCR"); } return label; }  static List<ManagedProperty> getProperties( Component objectType,
                                                       Object object ); static String createLabel( String name );  }### Answer:
@Test public void shouldReturnLabelFormatted() throws Exception { String label = ManagedUtils.createLabel("options.locking.supported"); assertTrue(label.equals("Options Locking Supported")); }
@Test public void shouldReturnErrorOnNullName() throws Exception { try { ManagedUtils.createLabel(null); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().equals("The name argument may not be null")); } }