why do you want to use an array, can you elaborate on your use case?
Instead of using the set method I recommend using the setProperty method, as it is a bit more convenient to use,
in general your usage of set is also fine though.
In the Position object it is “lng” and not “lon” for your information.
Like this you can set the position:
import c8y.Position;
Position position = new Position();
position.setAlt(BigDecimal.valueOf(0));
position.setLat(BigDecimal.valueOf(34));
position.setLng(BigDecimal.valueOf(23));
...
managedObjectRepresentation.setProperty("c8y_Position", position);