public static bool isEmptyOrNull(XYPlot plot) { if (plot != null) { int index = 0; for (int datasetCount = plot.getDatasetCount(); index < datasetCount; ++index) { if (!DatasetUtilities.isEmptyOrNull(plot.getDataset(index))) return false; } } return true; }