CeosHelper { public static File getFileFromInput(final Object input) { if (input instanceof String) { return new File((String) input); } else if (input instanceof File) { return (File) input; } return null; }  static File getVolumeFile(final File baseDir); static FilePointerRecord[] readFilePointers(final VolumeDescriptorRecord vdr); static String getLeaderFileName(final TextRecord textRecord); static String getTrailerFileName(final TextRecord textRecord); static String getSupplementalFileName(final TextRecord textRecord); static String getImageFileName(final TextRecord textRecord, final String ccd); static String getProductName(final TextRecord textRecord); static ProductData.UTC createUTCDate(final int year, final int dayOfYear, final int millisInDay); static double[] sortToFXYSumOrder(final double[] coeffs); static double[] convertLongToDouble(final long[] longs); static File getFileFromInput(final Object input);  }
@Test public void testGetFileFromInput() { String inputString = "testFile"; File result = CeosHelper.getFileFromInput(inputString); assertEquals(inputString, result.getName()); File inputFile = new File("anotherTest"); result = CeosHelper.getFileFromInput(inputFile); assertEquals(inputFile.getName(), result.getName()); result = CeosHelper.getFileFromInput(new Double(9)); assertNull(result); }