ActorsPackageDescriptionImpl implements ActorsPackageDescription { @Override public void describeProblems(@NotNull List<GenerationError> errors) { errors.addAll(mErrors); } ActorsPackageDescriptionImpl(@NotNull Element element); @Override boolean validate(); @Override void describeProblems(@NotNull List<GenerationError> errors); @NotNull @Override String getPackageName(); @NotNull @Override String getBuilderClassName(); @NotNull @Override ActorsPackage.AccessLevel getAccessLevel();  }
@Test public void describeProblems_ER0008_notPackage() { Mockito.doReturn(ElementKind.INTERFACE).when(mElement).getKind(); List<GenerationError> errors = new ArrayList<>(); ActorsPackageDescriptionImpl impl = new ActorsPackageDescriptionImpl(mElement); impl.describeProblems(errors); Assert.assertEquals(true, errors.get(0).isError); Assert.assertEquals(GenerationError.ER0008, errors.get(0).message); Assert.assertSame(mElement, errors.get(0).element); }
@Test public void describeProblems_noError_package() { List<GenerationError> errors = new ArrayList<>(); ActorsPackageDescriptionImpl impl = new ActorsPackageDescriptionImpl(mElement); impl.describeProblems(errors); Assert.assertEquals(0, errors.size()); }