### Question:
WorkflowAction { protected List<Resource> sortVfModulesByBaseFirst(List<Resource> vfModuleResources) { int count = 0; for (Resource resource : vfModuleResources) { if (resource.isBaseVfModule()) { Collections.swap(vfModuleResources, 0, count); break; } count++; } return vfModuleResources; }  void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils); void setBbInputSetup(BBInputSetup bbInputSetup); void selectExecutionList(DelegateExecution execution); void handleRuntimeException(DelegateExecution execution);  }### Answer:
@Test public void sortVfModulesByBaseFirstTest() { List<Resource> resources = new ArrayList<>(); Resource resource1 = new Resource(WorkflowType.VFMODULE, "111", false); resource1.setBaseVfModule(false); resources.add(resource1); Resource resource2 = new Resource(WorkflowType.VFMODULE, "222", false); resource2.setBaseVfModule(false); resources.add(resource2); Resource resource3 = new Resource(WorkflowType.VFMODULE, "333", false); resource3.setBaseVfModule(true); resources.add(resource3); List<Resource> result = workflowAction.sortVfModulesByBaseFirst(resources); assertEquals("333", result.get(0).getResourceId()); assertEquals("222", result.get(1).getResourceId()); assertEquals("111", result.get(2).getResourceId()); }