class RecentLogsRetriever {

    public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) {
        List<ApplicationLog> appLogs = client.getRecentLogs(appName);
        if (offset == null) {
            return appLogs;
        }
        return appLogs.stream()
                      .filter(appLog -> isLogNew(appLog, offset))
                      .collect(Collectors.toList());
    }

}