@Test
@PrepareForTest({CreateProject.class, File.class})

@SuppressWarnings("unchecked")
public void testExecute() throws Exception {
  // Given
  final ProjectFile projectFile = new ProjectFile();
  final WriteProjectFile writeProjectFile = mock(WriteProjectFile.class);
  final CreateProject command = spy(new CreateProject());
  whenNew(ProjectFile.class).withAnyArguments().thenReturn(projectFile);
  whenNew(WriteProjectFile.class).withAnyArguments().thenReturn(writeProjectFile);
  mockStatic(Files.class);
  when(Files.list(any())).thenReturn(EMPTY_LIST.stream());
  when(Files.newInputStream(any()))
      .thenReturn(new ByteArrayInputStream("hello, world".getBytes()));
  doNothing().when(command).prepare(any());
  // When
  command.setPrinter(mock(MessagePrinter.class));
  command.execute();
  // Then
  verify(writeProjectFile).execute();
}