class NewBlockMessage extends AbstractMessageData {

  public static NewBlockMessage readFrom(final MessageData message) {
    if (message instanceof NewBlockMessage) {
      return (NewBlockMessage) message;
    }
    final int code = message.getCode();
    if (code != NewBlockMessage.MESSAGE_CODE) {
      throw new IllegalArgumentException(
          String.format("Message has code %d and thus is not a NewBlockMessage.", code));
    }
    return new NewBlockMessage(message.getData());
  }

  private  NewBlockMessage(final Bytes data);

}