public class FailoverToyExample {
public static void packageOverviewExample1() {
Format[] formats = new Format[]{
NumberFormat.getInstance(), DateFormat.getDateInstance(), new MessageFormat("{1}, {0}"),};
Format format = (Format)Failover.object(Format.class, new CglibProxyFactory(), formats, RuntimeException.class);
System.out.println("Format a date: " + format.format(new Date()));
System.out.println("Format a message: " + format.format(new String[]{"John", "Doe"}));
System.out.println("Format a number: " + format.format(new Integer(42)));
}