/**
 * Copyright 2009 KaChing Group Inc. Licensed under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
 * or agreed to in writing, software distributed under the License is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package com.kaching.platform.converters;

public class InstantiatorsTest {

  // empty, for now
  
}

@@ -635,67 +635,2308 @@
 %0D%0A%0D%0A
-public class InstantiatorsTest %7B%0D%0A%0D%0A  // empty, for now%0D%0A  
+import static java.lang.String.format;%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0Aimport static org.junit.Assert.assertNotNull;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Apublic class InstantiatorsTest %7B%0D%0A%0D%0A  @Test%0D%0A  public void constructMe1() %7B%0D%0A    assertNotNull(Instantiators%0D%0A        .createInstantiator(ConstructMe1.class)%0D%0A        .newInstance());%0D%0A%0D%0A  %7D%0D%0A%0D%0A  @Test%0D%0A  public void constructMe2() %7B%0D%0A    ConstructMe2 instance = Instantiators%0D%0A        .createInstantiator(ConstructMe2.class)%0D%0A        .newInstance(%22Jack Bauer%22);%0D%0A    assertNotNull(instance);%0D%0A    assertEquals(%22Jack Bauer%22, instance.name);%0D%0A  %7D%0D%0A%0D%0A  @Test%0D%0A  public void constructMe3() %7B%0D%0A    ConstructMe3 instance = Instantiators%0D%0A        .createInstantiator(ConstructMe3.class)%0D%0A        .newInstance(%22Jack Bauer%22, %22First:Last%22);%0D%0A    assertNotNull(instance);%0D%0A    assertEquals(%22Jack Bauer%22, instance.name.content);%0D%0A    assertEquals(%22First%22, instance.pair.first);%0D%0A    assertEquals(%22Last%22, instance.pair.last);%0D%0A  %7D%0D%0A%0D%0A  static class ConstructMe1 %7B%0D%0A    ConstructMe1() %7B%7D%0D%0A  %7D%0D%0A%0D%0A  static class ConstructMe2 %7B%0D%0A    private final String name;%0D%0A    ConstructMe2(String name) %7B%0D%0A      this.name = name;%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A  static class ConstructMe3 %7B%0D%0A    private final WrappedString name;%0D%0A    private final ConvertedPair pair;%0D%0A    ConstructMe3(WrappedString name, ConvertedPair pair) %7B%0D%0A      this.name = name;%0D%0A      this.pair = pair;%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A  static class WrappedString %7B%0D%0A    private final String content;%0D%0A    WrappedString(String content) %7B%0D%0A      this.content = content;%0D%0A    %7D%0D%0A    @Override%0D%0A    public String toString() %7B%0D%0A      return content;%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A  @ConvertedBy(ConvertedPairConverter.class)%0D%0A  static class ConvertedPair %7B%0D%0A    private final String first;%0D%0A    private final String last;%0D%0A    ConvertedPair(String first, String last) %7B%0D%0A      this.first = first;%0D%0A      this.last = last;%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A  static class ConvertedPairConverter implements Converter%3CConvertedPair%3E %7B%0D%0A%0D%0A    @Override%0D%0A    public String toString(ConvertedPair value) %7B%0D%0A      return format(%22%25s:%25s%22, value.first, value.last);%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    public ConvertedPair fromString(String representation) %7B%0D%0A      String%5B%5D parts = representation.split(%22:%22);%0D%0A      return new ConvertedPair(parts%5B0%5D, parts%5B1%5D);%0D%0A    %7D%0D%0A%0D%0A  %7D%0D%0A
 %0D%0A%7D%0D

Highlighting simple uses cases of the library.