class PositionCalcUtil {

    public static PositionDTO newAvailablePosition(final NiFiServiceFacade serviceFacade) {
        final Set<ProcessGroupEntity> processGroups = serviceFacade.getProcessGroups(FlowController.ROOT_GROUP_ID_ALIAS);

        final List<PositionDTO> positions = processGroups.stream()//
                .filter(e -> e.getComponent() != null && e.getComponent().getPosition() != null)//
                .map(e -> e.getComponent().getPosition())//
                .collect(Collectors.toList());

        return newAvailablePosition(positions);
    }

}