### Question:
BASE1Header extends BaseHeader { public boolean isRejected() { return getLength() >= 26 && (header[22] & 0x80) == 0x80; } BASE1Header();  BASE1Header(String source, String destination);  BASE1Header(String source, String destination, int format);  BASE1Header(byte[] header); int getHLen(); void setHFormat(int hformat); int getFormat(); void setRtCtl(int i); void setFlags(int i); void setStatus(int i); void setBatchNumber(int i); void setFormat(int format); void setLen(int len); void setDestination(String dest); void setSource(String src); String getSource(); String getDestination(); void swapDirection(); boolean isRejected(); String getRejectCode(); String formatHeader(); static final int LENGTH; }### Answer:
@Test public void testIsRejected() throws Throwable { BASE1Header bASE1Header = new BASE1Header(); byte[] header = new byte[29]; header[22] = (byte) -55; bASE1Header.unpack(header); boolean result = bASE1Header.isRejected(); assertTrue(result, "result"); }
@Test public void testIsRejected1() throws Throwable { byte[] header = new byte[26]; header[22] = (byte) -128; BASE1Header bASE1Header = new BASE1Header(); bASE1Header.unpack(header); boolean result = bASE1Header.isRejected(); assertTrue(result, "result"); }
@Test public void testIsRejected2() throws Throwable { BASE1Header bASE1Header = new BASE1Header(); byte[] header = new byte[25]; bASE1Header.unpack(header); boolean result = bASE1Header.isRejected(); assertFalse(result, "result"); }