### Question:
AisBStaticDataReportPartB extends AbstractAisBStaticDataReport { @VisibleForTesting static Optional<String> extractCallSign(AisExtractor extractor) { String value = extractor.getString(90, 132); if(CALL_SIGN_NOT_AVAILABLE.contentEquals(value)) { return Optional.absent(); } else { return Optional.of(value); } } 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 testCallSignNotAvailable() { final String callSign = "@@@@@@@"; AisExtractor ex = createMock(AisExtractor.class); expect(ex.getString(anyInt(), anyInt())).andReturn(callSign).atLeastOnce(); replay(ex); Optional<String> result = AisBStaticDataReportPartB.extractCallSign(ex); assertFalse(result.isPresent()); verify(ex); }
@Test public void testCallSign() { final String vendorCallSign = "ABC"; AisExtractor ex = createMock(AisExtractor.class); expect(ex.getString(anyInt(), anyInt())).andReturn(vendorCallSign).atLeastOnce(); replay(ex); Optional<String> result = AisBStaticDataReportPartB.extractCallSign(ex); assertEquals(vendorCallSign, result.get()); verify(ex); }