@Test(expected = IllegalArgumentException.class) public void shouldFailToCreateInternalDataFromWrongAlgorithmType() { LearningAlgorithm.MealyLearner learner = mock(LearningAlgorithm.MealyLearner.class); algorithm.getInternalData(learner); }
@Override public String getInternalData(LearningAlgorithm.MealyLearner<String, String> learner) { if (!(learner instanceof DTLearnerMealy)) { throw new IllegalArgumentException("Can not read the internal data because the algorithm types" + "were different"); } return toJSON(((DTLearnerMealy<String, String>) learner).getDiscriminationTree()); }
DiscriminationTree extends AbstractLearningAlgorithm<String, String> implements Serializable { @Override public String getInternalData(LearningAlgorithm.MealyLearner<String, String> learner) { if (!(learner instanceof DTLearnerMealy)) { throw new IllegalArgumentException("Can not read the internal data because the algorithm types" + "were different"); } return toJSON(((DTLearnerMealy<String, String>) learner).getDiscriminationTree()); } }
DiscriminationTree extends AbstractLearningAlgorithm<String, String> implements Serializable { @Override public String getInternalData(LearningAlgorithm.MealyLearner<String, String> learner) { if (!(learner instanceof DTLearnerMealy)) { throw new IllegalArgumentException("Can not read the internal data because the algorithm types" + "were different"); } return toJSON(((DTLearnerMealy<String, String>) learner).getDiscriminationTree()); }  }
DiscriminationTree extends AbstractLearningAlgorithm<String, String> implements Serializable { @Override public String getInternalData(LearningAlgorithm.MealyLearner<String, String> learner) { if (!(learner instanceof DTLearnerMealy)) { throw new IllegalArgumentException("Can not read the internal data because the algorithm types" + "were different"); } return toJSON(((DTLearnerMealy<String, String>) learner).getDiscriminationTree()); }  @Override LearningAlgorithm.MealyLearner<String, String> createLearner(Alphabet<String> sigma,
            MembershipOracle<String, Word<String>> oracle); @Override String getInternalData(LearningAlgorithm.MealyLearner<String, String> learner); @Override void resume(LearningAlgorithm.MealyLearner<String, String> learner, byte[] data); }
DiscriminationTree extends AbstractLearningAlgorithm<String, String> implements Serializable { @Override public String getInternalData(LearningAlgorithm.MealyLearner<String, String> learner) { if (!(learner instanceof DTLearnerMealy)) { throw new IllegalArgumentException("Can not read the internal data because the algorithm types" + "were different"); } return toJSON(((DTLearnerMealy<String, String>) learner).getDiscriminationTree()); }  @Override LearningAlgorithm.MealyLearner<String, String> createLearner(Alphabet<String> sigma,
            MembershipOracle<String, Word<String>> oracle); @Override String getInternalData(LearningAlgorithm.MealyLearner<String, String> learner); @Override void resume(LearningAlgorithm.MealyLearner<String, String> learner, byte[] data);  }