### Question:
MetricSchema { @VisibleForTesting public static MetricSchema create( String name, String description, String valueDisplayName, Kind kind, ImmutableSet<LabelDescriptor> labels) { checkArgument(!name.isEmpty(), "Name must not be blank"); checkArgument(!description.isEmpty(), "Description must not be blank"); checkArgument(!valueDisplayName.isEmpty(), "Value Display Name must not be empty"); checkArgument(name.startsWith("/"), "Name must be URL-like and start with a '/'"); return new AutoValue_MetricSchema(name, description, valueDisplayName, kind, labels); } MetricSchema(); @VisibleForTesting static MetricSchema create(
      String name,
      String description,
      String valueDisplayName,
      Kind kind,
      ImmutableSet<LabelDescriptor> labels); abstract String name(); abstract String description(); abstract String valueDisplayName(); abstract Kind kind(); abstract ImmutableSet<LabelDescriptor> labels();  }### Answer:
@Test public void testCreate_blankNameField_throwsException() { IllegalArgumentException thrown = assertThrows( IllegalArgumentException.class, () -> MetricSchema.create( "", "description", "valueDisplayName", Kind.GAUGE, ImmutableSet.<LabelDescriptor>of())); assertThat(thrown).hasMessageThat().contains("Name must not be blank"); }
@Test public void testCreate_blankDescriptionField_throwsException() { IllegalArgumentException thrown = assertThrows( IllegalArgumentException.class, () -> MetricSchema.create( "/name", "", "valueDisplayName", Kind.GAUGE, ImmutableSet.<LabelDescriptor>of())); assertThat(thrown).hasMessageThat().contains("Description must not be blank"); }
@Test public void testCreate_blankValueDisplayNameField_throwsException() { IllegalArgumentException thrown = assertThrows( IllegalArgumentException.class, () -> MetricSchema.create( "/name", "description", "", Kind.GAUGE, ImmutableSet.<LabelDescriptor>of())); assertThat(thrown).hasMessageThat().contains("Value Display Name must not be empty"); }
@Test public void testCreate_nakedNames_throwsException() { IllegalArgumentException thrown = assertThrows( IllegalArgumentException.class, () -> MetricSchema.create( "foo", "description", "valueDisplayName", Kind.GAUGE, ImmutableSet.<LabelDescriptor>of())); assertThat(thrown).hasMessageThat().contains("Name must be URL-like and start with a '/'"); }