// @formatter:on
public static Optional<KNXComObject> retrieveComObjectByDatapointId(final KNXProject knxProject,
			final int deviceIndex, final int dataPointId) {
		// TODO: how to identify the correct device if there are several devices in the
		// list?
		final KNXDeviceInstance knxDeviceInstance = knxProject.getDeviceInstances().get(deviceIndex);
		// TODO: maybe create a map from datapoint id to ComObject????
		// @formatter:off
		return knxDeviceInstance
				.getComObjects()
				.values()
				.stream()
				.filter(c -> c.getNumber() == dataPointId)
				.filter(c -> c.isGroupObject())
				.findFirst();
		// @formatter:on
	}
.filter(c -> c.isGroupObject())
.findFirst();
// @formatter:on
}
final KNXDeviceInstance knxDeviceInstance = knxProject.getDeviceInstances().get(deviceIndex);
// TODO: maybe create a map from datapoint id to ComObject????
// @formatter:off
return knxDeviceInstance
.getComObjects()
.values()
.stream()
.filter(c -> c.getNumber() == dataPointId)
.filter(c -> c.isGroupObject())
.findFirst();
// @formatter:on
}
public static Optional<KNXComObject> retrieveComObjectByDatapointId(final KNXProject knxProject,
final int deviceIndex, final int dataPointId) {
// TODO: how to identify the correct device if there are several devices in the
// list?
final KNXDeviceInstance knxDeviceInstance = knxProject.getDeviceInstances().get(deviceIndex);
// TODO: maybe create a map from datapoint id to ComObject????
// @formatter:off
return knxDeviceInstance
.getComObjects()
.values()
.stream()
.filter(c -> c.getNumber() == dataPointId)
.filter(c -> c.isGroupObject())
.findFirst();
// @formatter:on
}