@@ -0,0 +1,2859 @@
+/*%0A * Copyright (c) 2016. Real Time Genomics Limited.%0A *%0A * All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted provided that the following conditions are%0A * met:%0A *%0A * 1. Redistributions of source code must retain the above copyright%0A *    notice, this list of conditions and the following disclaimer.%0A *%0A * 2. Redistributions in binary form must reproduce the above copyright%0A *    notice, this list of conditions and the following disclaimer in the%0A *    documentation and/or other materials provided with the%0A *    distribution.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage com.rtg.vcf.annotation;%0A%0Aimport com.rtg.vcf.header.FormatField;%0Aimport com.rtg.vcf.header.MetaType;%0Aimport com.rtg.vcf.header.VcfNumber;%0A%0Aimport junit.framework.TestCase;%0A%0A/**%0A */%0Apublic class FormatterTest extends TestCase %7B%0A%0A  public void testFormatting() %7B%0A    assertEquals(%221%22, Formatter.DEFAULT.toString(1));%0A    assertEquals(%22hello%22, Formatter.DEFAULT.toString(%22hello%22));%0A    assertEquals(%221.11111%22, Formatter.DEFAULT.toString(1.11111));%0A    assertEquals(%221.111%22, Formatter.DEFAULT_DOUBLE.toString(1.11111));%0A  %7D%0A%0A  public void testGetFormatter() %7B%0A    assertEquals(Formatter.DEFAULT, Formatter.getFormatter(new FormatField(%22A%22, MetaType.INTEGER, VcfNumber.ONE, %22description%22)));%0A    assertEquals(Formatter.DEFAULT, Formatter.getFormatter(new FormatField(%22A%22, MetaType.STRING, VcfNumber.ONE, %22description%22)));%0A    assertEquals(Formatter.DEFAULT, Formatter.getFormatter(new FormatField(%22A%22, MetaType.CHARACTER, VcfNumber.ONE, %22description%22)));%0A    assertEquals(Formatter.DEFAULT_DOUBLE, Formatter.getFormatter(new FormatField(%22A%22, MetaType.FLOAT, VcfNumber.ONE, %22description%22)));%0A%0A    try %7B%0A      Formatter.getFormatter(new FormatField(%22A%22, MetaType.FLAG, VcfNumber.ONE, %22description%22));%0A      fail();%0A    %7D catch (IllegalArgumentException ignored) %7B%0A    %7D%0A    try %7B%0A      Formatter.getFormatter(new FormatField(%22A%22, MetaType.INTEGER, VcfNumber.ALTS, %22description%22));%0A      fail();%0A    %7D catch (IllegalArgumentException ignored) %7B%0A    %7D%0A  %7D%0A%7D%0A

Add unit tests