if (alignment instanceof Trailing) {
Trailing trailing = (Trailing) alignment.clone();
trailing.setTrailing(postTrail);
constraints = new Constraints(constraints.getHorizontal(), trailing);
} else if (alignment instanceof Bilateral) {
Bilateral bilateral = (Bilateral) alignment.clone();
bilateral.setTrailing(postTrail);
constraints = new Constraints(constraints.getHorizontal(), bilateral);
} else if (alignment instanceof Leading) {
Bilateral bilateral = new Bilateral(((Leading)alignment).getLeading(), postTrail, ((Leading) alignment).getSize());
constraints = new Constraints(constraints.getHorizontal(), bilateral);