SpecInfo { String getOutputFilename() { String packageDir = packageName.replace('.', File.separatorChar); if (packageDir.length() > 0) { packageDir += File.separatorChar; } return packageDir + className + ".java"; } SpecInfo(String className, @Nullable String packageName);   SpecInfo(String className, @Nullable String packageName, Set<File> includedFiles); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testGetOutputFilename() { SpecInfo clazz = new SpecInfo("Bar", "org.foo"); assertThat(new File(clazz.getOutputFilename())).isEqualTo(new File("org/foo/Bar.java")); }
@Test public void testGetOutputFilename_defaultPackage() { SpecInfo clazz = new SpecInfo("Bar", null); assertThat(new File(clazz.getOutputFilename())).isEqualTo(new File("Bar.java")); }