Код: Выделить всё
public class Plane implements Flyable
{
private final int numberOfEngines;
private final String model;
public Plane(int engines, String m)
{
numberOfEngines = engines;
model = m;
}
@Override
public String toString()
{
return String.format("%s with %d engines", model, numberOfEngines);
}
@Override
public void launch() {
System.out.println("Rolling until take-off");
}
@Override
public void land() {
System.out.println("Rolling to a stop");
}
}
Код: Выделить всё
class PlaneTest {
@Test
void testToString() {
assertEquals("Boing with 4 engines", Plane.this.toString());
}
@Test
void testLaunch() {
fail("Not yet implemented");
}
@Test
void testLand() {
fail("Not yet implemented");
}
Подробнее здесь: https://stackoverflow.com/questions/602 ... ide-method