### Question:
HttpProtocolVersion implements HttpProtocol { public static HttpProtocolVersion of(final int major, final int minor) { if (major == 1) { if (minor == 1) { return HTTP_1_1; } if (minor == 0) { return HTTP_1_0; } } else if (major == 2 && minor == 0) { return HTTP_2_0; } return new HttpProtocolVersion(major, minor); } private  HttpProtocolVersion(final int major, final int minor); static HttpProtocolVersion of(final int major, final int minor); int major(); int minor(); void writeTo(final Buffer buffer); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override String name(); static final HttpProtocolVersion HTTP_1_1; static final HttpProtocolVersion HTTP_1_0; static final HttpProtocolVersion HTTP_2_0; }### Answer:
@Test public void testFromMajorAndMinorReturnsConstants() { assertSame(HTTP_1_1, HttpProtocolVersion.of(1, 1)); assertSame(HTTP_1_0, HttpProtocolVersion.of(1, 0)); }
@Test(expected = IllegalArgumentException.class) public void testIllegalMajorVersionLT0() { HttpProtocolVersion.of(-1, 0); }
@Test(expected = IllegalArgumentException.class) public void testIllegalMajorVersionGT9() { HttpProtocolVersion.of(10, 0); }
@Test(expected = IllegalArgumentException.class) public void testIllegalMinorVersionLT0() { HttpProtocolVersion.of(1, -1); }
@Test(expected = IllegalArgumentException.class) public void testIllegalMinorVersionGT9() { HttpProtocolVersion.of(1, 10); }