### Question:
AisBStaticDataReportPartB extends AbstractAisBStaticDataReport { @VisibleForTesting static Optional<Integer> extractDimensionD(AisExtractor extractor) { int value = extractor.getValue(156, 162); return value != DIMENSION_ZERO ? Optional.of(value) : Optional.absent(); } AisBStaticDataReportPartB(String message, int padBits);  AisBStaticDataReportPartB(String message, String source, int padBits);  AisBStaticDataReportPartB(AisExtractorFactory factory, String message, String source,
            int padBits); @Override String toString(); int getShipType(); Optional<String> getCallsign(); Optional<Integer> getDimensionA(); Optional<Integer> getDimensionB(); Optional<Integer> getDimensionC(); Optional<Integer> getDimensionD(); Optional<Integer> getLengthMetres(); Optional<Integer> getWidthMetres(); String getVendorManufacturerId(); Integer getVendorUnitModelCode(); Integer getVendorUnitSerialNumber();  }### Answer:
@Test public void testDimensionD() { final Integer dimensionD = 123; AisExtractor ex = createMock(AisExtractor.class); expect(ex.getValue(anyInt(), anyInt())).andReturn(dimensionD).atLeastOnce(); replay(ex); Optional<Integer> result = AisBStaticDataReportPartB.extractDimensionD(ex); assertEquals(dimensionD, result.get()); verify(ex); }