Get all finished process instances

How do I fetch all process instances using flowable API?

This code snippet fetches only Active process instances but I want finished process instances as well.

List<org.flowable.engine.runtime.ProcessInstance> query = processEngine.getRuntimeService().createProcessInstanceQuery().active().list();

try
processEngine.getHistoryService().createHistoricProcessInstanceQuery().list();

@yepengchen getting null in the response. System.out.println(processEngine.getHistoryService().createHistoricProcessInstanceQuery().finished().list().get(0).getName());

Are there any results in the processEngine.getHistoryService().createHistoricProcessInstanceQuery().finished().list() list? DId you set a name for the process instance (otherwise it is logical null is returned)?