PartitionSpec { protected String getFormattedTime(String input) { if (input == null || input.equals("")) { return null; } long ts; switch (this.interpreter) { case SECONDS: ts = (long) (Double.parseDouble(input) * 1000); break; case MILLISECONDS: ts = (long) (Double.parseDouble(input)); break; default: throw new RuntimeException("Unknown interpreter"); } ts = Time.toMilliseconds(ts); if (this.secondsToRound > 0) { ts = Math.round((double) ts / (this.secondsToRound * 1000)) * (this.secondsToRound * 1000); } return this.dateTimeFormatter.print(ts); } PartitionSpec();  PartitionSpec(String name, List<String> sources, Interpreter interpreter, String format,
      int secondsToRound);  PartitionSpec(String name, List<String> sources, Interpreter interpreter);  PartitionSpec(String name, List<String> sources);  PartitionSpec(String name, String... sources); String getName(); List<String> getSources(); Interpreter getInterpreter(); StringFormat getStringFormat(); void setStringFormat(StringFormat format); void setFormat(String format); String getFormat(); String interpret(String input); String toString();  }
@Test(expected = RuntimeException.class) public void testInvalidInterpreter() { PartitionSpec spec = new PartitionSpec("test", Collections.emptyList(), Interpreter.STATIC, "static", 0); spec.getFormattedTime("will fail"); }