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
| package cz.cez.trading.algo.core; | |
| import static org.junit.jupiter.api.Assertions.assertEquals; | |
| import org.junit.jupiter.api.Test; | |
| public class GenericPolymorphicFunctionTest { | |
| @Test | |
| public void testPolymorphicFunction() { |
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
| import java.math.BigDecimal; | |
| import org.junit.jupiter.api.Test; | |
| public class Sandbox { | |
| @Test | |
| public void testFloat() { | |
| double raw = 21.05d; | |
| double computed = 21.025d+0.025d; | |
| double rounded = Math.round((21.025d+0.025d) * 1000d) / 1000d; | |
| System.out.println(raw); |
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
| public interface Index() { | |
| /* | |
| * @return mutable copy of indexes contained in this instance. | |
| */ | |
| MutableIndex beginMutation(); | |
| /* | |
| * Example usage of indexes for data retrieval. | |
| */ | |
| PrimaryKey findBySomeAttributeValue(String value); |
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
| package x; | |
| /** | |
| * <p> | |
| * Wildcards in "indirect" or "second level" generics. | |
| * <p> | |
| * {@link #list} contains generic items. | |
| * {@link #testWildcard()} and {@link #testGeneric()} wants to work with that items | |
| * and shouldn't care about it's generic type <i>as long as it's the same type through the | |
| * whole method<i>. How to express that correctly (if it's possible at all)? |
OlderNewer