@Test
public void testCreateIchipb() throws NitfFormatException {

  BufferedImage bufferedImage = mock(BufferedImage.class);
  int originalWidth = 200;
  int originalHeight = 100;
  when(bufferedImage.getWidth()).thenReturn(originalWidth);
  when(bufferedImage.getHeight()).thenReturn(originalHeight);
  int chipX = 20;
  int chipY = 10;
  Tre tre = catalogOutputAdapter.createIchipb(bufferedImage, chipX, chipY, 160, 80);
  assertTreEntry(tre, "XFRM_FLAG", TWO_DIGIT_REGEX, UINT);
  assertTreEntry(tre, "SCALE_FACTOR", Pattern.compile("^[0-9]{4}\\.[0-9]{5}$"), REAL);
  assertTreEntry(tre, "ANAMRPH_CORR", TWO_DIGIT_REGEX, UINT);
  assertTreEntry(tre, "SCANBLK_NUM", TWO_DIGIT_REGEX, UINT);
  assertTreEntry(tre, "OP_ROW_11", COORD_REGEX, REAL);
  assertTreEntry(tre, "OP_COL_11", COORD_REGEX, REAL);
  assertTreEntry(tre, "OP_ROW_12", COORD_REGEX, REAL);
  assertTreEntry(tre, "OP_COL_12", COORD_REGEX, REAL);
  assertTreEntry(tre, "OP_ROW_21", COORD_REGEX, REAL);
  assertTreEntry(tre, "OP_COL_21", COORD_REGEX, REAL);
  assertTreEntry(tre, "OP_ROW_22", COORD_REGEX, REAL);
  assertTreEntry(tre, "OP_COL_22", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_ROW_11", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_COL_11", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_ROW_12", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_COL_12", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_ROW_21", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_COL_21", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_ROW_22", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_COL_22", COORD_REGEX, REAL);
  assertTreEntry(tre, "FI_ROW", EIGHT_DIGIT_REGEX, UINT);
  assertTreEntry(tre, "FI_COL", EIGHT_DIGIT_REGEX, UINT);
  assertThat(tre.getDoubleValue("OP_ROW_11"), closeTo(0.5, 0.01));
  assertThat(tre.getDoubleValue("OP_COL_11"), closeTo(0.5, 0.01));
  assertThat(tre.getDoubleValue("OP_ROW_12"), closeTo(0.5, 0.01));
  assertThat(tre.getDoubleValue("OP_COL_12"), closeTo(originalWidth - 0.5, 0.01));
  assertThat(tre.getDoubleValue("OP_ROW_21"), closeTo(originalHeight - 0.5, 0.01));
  assertThat(tre.getDoubleValue("OP_COL_21"), closeTo(0.5, 0.01));
  assertThat(tre.getDoubleValue("OP_ROW_22"), closeTo(originalHeight - 0.5, 0.01));
  assertThat(tre.getDoubleValue("OP_COL_22"), closeTo(originalWidth - 0.5, 0.01));
  assertThat(tre.getDoubleValue("FI_ROW_11"), closeTo(chipY + 0.5, 0.01));
  assertThat(tre.getDoubleValue("FI_COL_11"), closeTo(chipX + 0.5, 0.01));
  assertThat(tre.getDoubleValue("FI_ROW_12"), closeTo(chipY + 0.5, 0.01));
  assertThat(tre.getDoubleValue("FI_COL_12"), closeTo(originalWidth - chipX - 0.5, 0.01));
  assertThat(tre.getDoubleValue("FI_ROW_21"), closeTo(originalHeight - chipY - 0.5, 0.01));
  assertThat(tre.getDoubleValue("FI_COL_21"), closeTo(chipX + 0.5, 0.01));
  assertThat(tre.getDoubleValue("FI_ROW_22"), closeTo(originalHeight - chipY - 0.5, 0.01));
  assertThat(tre.getDoubleValue("FI_COL_22"), closeTo(originalWidth - chipX - 0.5, 0.01));
}