@Test
public void createUnmodifiableStatementShouldCopyArrayDefensively() throws Exception {

    // setup
    final TypeMirror mirror = mock(TypeMirror.class);
    when(mirror.getKind()).thenReturn(TypeKind.ARRAY);
    // exercise
    final CodeBlock actual = CodeBlocks.createUnmodifiableStatement(mirror, "value");
    // verify
    assertThat(actual.toString())
            .isEqualTo("java.util.Arrays.copyOf(value, value.length)");
}