StandaloneYAML extends YAML { @Override protected Writer writer() throws IOException { return filer.createResource(StandardLocation.CLASS_OUTPUT, "", "plugin.yml").openWriter(); } StandaloneYAML(Filer filer, Messager messager);   }
@Test void writer() throws IOException { var writer = mock(Writer.class); FileObject object = when(mock(FileObject.class).openWriter()).thenReturn(writer).getMock(); when(filer.createResource(any(), any(), any())).thenReturn(object); assertEquals(writer, yaml.writer()); verify(filer).createResource(StandardLocation.CLASS_OUTPUT, "", "plugin.yml"); verify(object).openWriter(); }