class FirmwareImage implements Chunk.Chunkable {

    public int blockCount() {
        return (int) Math.ceil((double) data().length / FW_BLOCK_SIZE);
    }

}

class FirmwareImageTest {

     byte[] rawImageData_valid;
     byte[] rawImageData_tooShort;
     byte[] rawImageData_invalid;

    @Test
    public void testBlockCount() throws ImageParsingException {

        FirmwareImage image1 = new FirmwareImage(rawImageData_valid, "");
        FirmwareImage image2 = new FirmwareImage(rawImageData_invalid, "");
        assertThat(image1.blockCount()).isEqualTo(1);
        assertThat(image2.blockCount()).isEqualTo(3);
    }

}