Java 01. ДЗ 05. Малютина Катя, подгруппа 2#58
Open
ekaterinaMaljutina wants to merge 7 commits intojava-course-au:masterfrom
Open
Java 01. ДЗ 05. Малютина Катя, подгруппа 2#58ekaterinaMaljutina wants to merge 7 commits intojava-course-au:masterfrom
ekaterinaMaljutina wants to merge 7 commits intojava-course-au:masterfrom
Conversation
sproshev
suggested changes
Apr 10, 2017
| public final class Collections { | ||
|
|
||
| public static <T, R> | ||
| Iterable<R> map(Function1<? super T, R> f, Iterable<T> a) { |
There was a problem hiding this comment.
см что написано про возвращаемые типы в задании
|
|
||
| public abstract Boolean apply(T t); | ||
|
|
||
| static final Predicate ALWAYS_TRUE = new Predicate() { |
| } | ||
| }; | ||
|
|
||
| static final Predicate ALWAYS_FALSE = new Predicate() { |
| @@ -0,0 +1,272 @@ | |||
| package ru.spbau.mit; | |||
There was a problem hiding this comment.
wildcard'ы не проверяются
ленивость предикатов не проверяется
тесты конечно желательно по соответствующим классам разносить
Author
|
@sproshev тут, я наверно забыла написать, что поправила замечания) |
sproshev
suggested changes
May 6, 2017
| public Boolean apply(Object o) { | ||
| return false; | ||
| } | ||
| }; |
There was a problem hiding this comment.
надо заиспользовать ALWAYS_T и F в тестах, тогда станет понятно, есть ли какие-то проблемы в них)
| ArrayList<String> str = new ArrayList<>(); | ||
| str.add("bbbb"); | ||
| str.add("aaa"); | ||
| str.add("ccc"); |
There was a problem hiding this comment.
List<String> str = Arrays.asList("bbbb", "aaa", "ccc");
| public Boolean apply(Object object) { | ||
| return null; | ||
| } | ||
| }, new ArrayList<Integer>()); |
| for (int i = value, n = 0; n < 20; i++, n++) { | ||
| Assert.assertTrue(i + 1 == f.apply(i)); | ||
| Assert.assertTrue(i - 1 == g.apply(i)); | ||
| Assert.assertTrue(i == f.compose(g).apply(i)); |
Author
|
@sproshev Поправила. |
|
|
Author
|
@sproshev Поправила. |
|
9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@sproshev