### Question:
FramedMTUAttribute extends Attribute { public int getMtu() { return mtu; } FramedMTUAttribute(int mtu);  FramedMTUAttribute(byte[] octets); int getMtu(); String toStringImpl();  }### Answer:
@Test public void testHighest() throws IOException { final FramedMTUAttribute a = new FramedMTUAttribute(65535); Assert.assertEquals(a.getMtu(), 65535, "mtu should be 65535"); final byte[] bytes = a.getOctets(); Assert.assertEquals(bytes[0], AttributeType.FRAMED_MTU.getTypeCode()); Assert.assertEquals(bytes[1], 6); final FramedMTUAttribute b = new FramedMTUAttribute(bytes); Assert.assertEquals(b.getMtu(), 65535, "mtu created from octets should be 65535"); }
@Test public void testHighestFromOctets() throws IOException { final byte[] octets = new byte[] {(byte) AttributeType.FRAMED_MTU.getTypeCode(), 6, 0, 0, (byte) 255, (byte) 255}; final FramedMTUAttribute a = new FramedMTUAttribute(octets); Assert.assertEquals(a.getMtu(), 65535, "mtu should be 65535"); }
@Test public void testLowest() throws IOException { final FramedMTUAttribute a = new FramedMTUAttribute(64); Assert.assertEquals(a.getMtu(), 64, "mtu should be 64"); final byte[] bytes = a.getOctets(); Assert.assertEquals(bytes[0], AttributeType.FRAMED_MTU.getTypeCode()); Assert.assertEquals(bytes[1], 6); final FramedMTUAttribute b = new FramedMTUAttribute(bytes); Assert.assertEquals(b.getMtu(), 64, "mtu created from octets should be 64"); }
@Test public void testLowestFromOctets() throws IOException { final byte[] octets = new byte[] {(byte) AttributeType.FRAMED_MTU.getTypeCode(), 6, 0, 0, 0, 64}; final FramedMTUAttribute a = new FramedMTUAttribute(octets); Assert.assertEquals(a.getMtu(), 64, "mtu should be 64"); }