AliasMessage implements Message { public static Builder builder(String previousId) { return new Builder(previousId); }  static Builder builder(String previousId); abstract String previousId(); Builder toBuilder();  }
@Test public void invalidPreviousIdThrows() { try { AliasMessage.builder(null); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("previousId cannot be null or empty."); } }