### Question:
IbftSubProtocol implements SubProtocol { @Override public boolean isValidMessageCode(final int protocolVersion, final int code) { switch (code) { case IbftV2.PROPOSAL: case IbftV2.PREPARE: case IbftV2.COMMIT: case IbftV2.ROUND_CHANGE: return true; default: return false; } }  static IbftSubProtocol get(); @Override String getName(); @Override int messageSpace(final int protocolVersion); @Override boolean isValidMessageCode(final int protocolVersion, final int code); @Override String messageName(final int protocolVersion, final int code); static String NAME; static final Capability IBFV1; }### Answer:
@Test public void allIbftMessageTypesAreRecognisedAsValidByTheSubProtocol() { final IbftSubProtocol subProt = new IbftSubProtocol(); assertThat(subProt.isValidMessageCode(1, 0)).isTrue(); assertThat(subProt.isValidMessageCode(1, 1)).isTrue(); assertThat(subProt.isValidMessageCode(1, 2)).isTrue(); assertThat(subProt.isValidMessageCode(1, 3)).isTrue(); }
@Test public void invalidMessageTypesAreNotAcceptedByTheSubprotocol() { final IbftSubProtocol subProt = new IbftSubProtocol(); assertThat(subProt.isValidMessageCode(1, 4)).isFalse(); }